Skip to content

Make crop() work with all PDFs #21

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

Open
cboulanger opened this issue May 26, 2017 · 3 comments
Open

Make crop() work with all PDFs #21

cboulanger opened this issue May 26, 2017 · 3 comments
Assignees

Comments

@cboulanger
Copy link
Collaborator

@tcr : I have trouble understanding how crop() is supposed to work. I have updated the method documentation as per this stackoverflow answer but running tests I have trouble getting a meaningful result. For example,

 scissors(infile)
        .pages(1,2)
        .crop(0,0,40,70)
        .pdfStream()
        .pipe(fs.createWriteStream(outfile)

just produces pages 1 and 2 of the infile uncropped, although it should return a 40X70 box from the lower left (112x196 mm).

Did this ever work for you?

@cboulanger cboulanger self-assigned this May 26, 2017
@tcr
Copy link
Owner

tcr commented May 26, 2017

I believe it worked on some PDFs, but not every one. It requires that there be a /Cropbox value in the PDF which isn't a guarantee. See the second part of this stack overflow answer for a possibly more universal implementation.

@cboulanger
Copy link
Collaborator Author

Ok, thanks, that's good to know. Won't be able to work on this now, but hopefully later.

@cboulanger cboulanger changed the title understanding crop() arguments and result Make crop() work with all PDFs May 27, 2017
@cboulanger
Copy link
Collaborator Author

cboulanger commented Jun 3, 2017

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

No branches or pull requests

2 participants