Pdf4Eclipse icon indicating copy to clipboard operation
Pdf4Eclipse copied to clipboard

Optionally auto-crop pages

Open robamler opened this issue 12 years ago • 1 comments

There should be an option to auto-crop pages. This would make the use of Texlipse and Pdf4Eclipse even more awesome.

I use a tex editor view and a pdf4eclipse view next to each other so that I have a preview of the document I'm currently editing next to its tex source code. In such a setup, displaying the page margins of the pdf just wastes screen real estate. It would therefore be helpful to have a toolbar button that toggles between displaying the full page and displaying the page without any (automatically detected) white margins. Of course, one can already zoom into the page and fit the relevant part of the page to the screen but this does not play well with scrolling if even and odd pages have alternating left/right margins. I could try to implement this feature myself if you provide me with some hints about where to start.

robamler avatar May 08 '12 19:05 robamler

Yes, indeed that would be a nice addition and I would be happy if you provide a patch for that. I see two possible ways how to implement this: Either directly on the pdf level, you can detect where the content is located inside the page and crop the other parts, or --probably easier to implement-- you look at the final rendered page image and detect white borders. For the second approach you can create a filter that provides a new cropped image out of the BufferedImage that is returned by the renderer in the showPage method in PDFPageViewer.

Borisvl avatar May 09 '12 10:05 Borisvl