mirror of
https://github.com/zen-browser/pdf.js.git
synced 2025-07-08 01:10:08 +02:00
Move the getPdfFilenameFromUrl
helper function from web/ui_utils.js
and into src/display/display_utils.js
It seems reasonable to place this alongside the *similar* `getFilenameFromUrl` helper function. This way, with the changes in the next patch, we also avoid having to expose the `isDataScheme` function in the API itself and we instead expose `getPdfFilenameFromUrl` in the API (which feels overall more appropriate).
This commit is contained in:
parent
a164941351
commit
bd9dee1544
8 changed files with 225 additions and 226 deletions
|
@ -13,12 +13,12 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { createPromiseCapability, PDFDateString } from "pdfjs-lib";
|
||||
import {
|
||||
getPageSizeInches,
|
||||
getPDFFileNameFromURL,
|
||||
isPortraitOrientation,
|
||||
} from "./ui_utils.js";
|
||||
createPromiseCapability,
|
||||
getPdfFilenameFromUrl,
|
||||
PDFDateString,
|
||||
} from "pdfjs-lib";
|
||||
import { getPageSizeInches, isPortraitOrientation } from "./ui_utils.js";
|
||||
|
||||
const DEFAULT_FIELD_CONTENT = "-";
|
||||
|
||||
|
@ -140,7 +140,7 @@ class PDFDocumentProperties {
|
|||
pageSize,
|
||||
isLinearized,
|
||||
] = await Promise.all([
|
||||
contentDispositionFilename || getPDFFileNameFromURL(this.url),
|
||||
contentDispositionFilename || getPdfFilenameFromUrl(this.url),
|
||||
this._parseFileSize(contentLength),
|
||||
this._parseDate(info.CreationDate),
|
||||
this._parseDate(info.ModDate),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue