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,8 +13,7 @@
|
|||
* limitations under the License.
|
||||
*/
|
||||
|
||||
import { getPDFFileNameFromURL } from "./ui_utils.js";
|
||||
import { loadScript } from "pdfjs-lib";
|
||||
import { getPdfFilenameFromUrl, loadScript } from "pdfjs-lib";
|
||||
|
||||
async function docPropertiesLookup(pdfDocument) {
|
||||
const url = "",
|
||||
|
@ -37,7 +36,7 @@ async function docPropertiesLookup(pdfDocument) {
|
|||
...info,
|
||||
baseURL: baseUrl,
|
||||
filesize: contentLength,
|
||||
filename: contentDispositionFilename || getPDFFileNameFromURL(url),
|
||||
filename: contentDispositionFilename || getPdfFilenameFromUrl(url),
|
||||
metadata: metadata?.getRaw(),
|
||||
authors: metadata?.get("dc:creator"),
|
||||
numPages: pdfDocument.numPages,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue