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

Add option to crop white borders #256

Closed
wants to merge 1 commit into from
Closed

Add option to crop white borders #256

wants to merge 1 commit into from

Conversation

MatejSpindler
Copy link
Contributor

Some printers in CAD programs can only print to standard page sizes, if you want to create a PDF of custom size like extended A3, usual workflow is to print to A2 or A1 and then crop extra white border.

With this change this operation is completed with just one click.

Size of white borders is determined by rendering the page with Cairo and then examining pixels for color other then white. This seems like a brute force approach, but I couldn't find any other solution.

@jeromerobert jeromerobert added this to the 1.7.0 milestone Aug 5, 2020
@jeromerobert
Copy link
Member

Thank you.

  • The pdfarranger.pdfarranger module is already too bloated. May be I should move crop_white_borders and crop_page_dialog to a pdfarranger.crop module. I'll do somethink like that, then merge and adapt your PR.

  • Would you mind if I move this action to the crop dialog ? I imagine an autocrop button on the crop dialog which automatically set the crop parameters. This would avoid to add a new action in the menus and this would allow the user to tweak the result of the autocrop. The downside is that it add extra clicks (open/close dialog) when you just want autocrop. This is not for now as the crop feature need a rework: space units instead of %, allow extends (negative crop).

@MatejSpindler
Copy link
Contributor Author

Sorry for the late answer. It was a busy week.

Regarding your first point, sure that module is getting big and hard to navigate. Splitting it is a good idea,

For the second point, it seems to me crop dialogue for a selection of pages applies the same crop to all pages. How do you plan to implement different per page crop regions in the selection?

The attached test file is a good representation of my daily workflow:
AutoCrop-test.pdf

@jeromerobert
Copy link
Member

Merged: 3320f4f c5c41cb

@mara004
Copy link
Contributor

mara004 commented Jun 28, 2021

Wow, that's a nice feature.

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

Successfully merging this pull request may close these issues.

None yet

3 participants