Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get access to converted file name #14

Open
abulhuman opened this issue May 28, 2021 · 1 comment
Open

Get access to converted file name #14

abulhuman opened this issue May 28, 2021 · 1 comment

Comments

@abulhuman
Copy link

I was trying this out and it worked fine but when it converts a file it adds an additional -1 or -01 right before the file format.
Like this,
source filename: 1622204835226-ASSEMBLY LANGUAGE.pdf
destination filename: 1622204835226-ASSEMBLY LANGUAGE-01.png or 1622204835226-ASSEMBLY LANGUAGE-001.png

This adds an unnecessary complication since there is no way to determine the destination filename from the source filename. Is there any way that enables me to get the destination filename or even modify it?

@Soneliem
Copy link

A little late but for future reference:

  1. Navigate to node_modules\pdf-poppler\lib\convert.js
  2. Replace the following lines:
if (opts.page) {
    args.push(['-f']);
    args.push([parseInt(opts.page)]);
    args.push(['-l']);
    args.push([parseInt(opts.page)]);
}
  1. With this: args.push(['-singlefile']);

Keep in mind this forces pdftocairo to only convert the first page and ignores all other pages.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants