[ 
https://issues.apache.org/jira/browse/PDFBOX-4069?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16329226#comment-16329226
 ] 

Kristian Jörg commented on PDFBOX-4069:
---------------------------------------

That would work.

But would need one to actually extend classes in pdfbox which might become 
broken if you change those classes in future. A simpler approach that needs no 
programming; extend the api with some methods that take a new enum type 
parameter, which can have the values CROPBOX, TRIMBOX, BLEEDBOX or whatever is 
meaningful. Implementation of the enum could be analogous to the ImageType enum 
you have, which makes things easy to implement on your side. Would be that much 
simpler to use. You could retain the old methods the same as now - keeping the 
api intact for old users and default the cropping to CROPBOX for those methods.

> Rendering with trimbox not possible
> -----------------------------------
>
>                 Key: PDFBOX-4069
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4069
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.7
>            Reporter: Kristian Jörg
>            Priority: Major
>   Original Estimate: 1h
>  Remaining Estimate: 1h
>
> I have a PDF with cropmarks for printing that i want to render without 
> cropmarks visible. The default implementation in  PDRenderer uses 
> page.getCropBox() to decide the visible part of a page. But there is no way 
> to override that to use trimbox - which is what I need.
> Further, trying to extend PDRenderer to change the implementation to use 
> trimbox instead of cropbox fails, because the method renderImage() calls the 
> constructor of PageDrawerParameters, which unfurtunately insn't visible (not 
> public). I couldn't find a way to solve that. Instead I ended up installing 
> the whole pdfbox source and patching up the PDFRenderer.java file according 
> to my needs. That gave me the rendering output I expected, i.e the cropmarks 
> gone.
> So please make it possible to choose which cropping to use (cropbox, trimbox, 
> bleedbox) for rendering and perhaps look over the possibility to extend these 
> classes without visibility issues.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to