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

Maruan Sahyoun commented on PDFBOX-5522:
----------------------------------------

for 1) doing it in COSWriter you no longer have the context of what type of 
object it is other than the low level COS objects. i.e. you don't have an 
information of what's allowed as properties, object types ...

for 2) would do that on the higher level object as you have more context about 
the type of object (acknowledged  it's probably less work on  the COS writer). 
I'm assuming it's mainly images you're looking to do a different compression to.

Maybe take a look at the pdmodel/fixup and it's content. Maybe an approach we 
can extend on for your use case?

> Add public void save(COSWriter writer) to PDDocument
> ----------------------------------------------------
>
>                 Key: PDFBOX-5522
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5522
>             Project: PDFBox
>          Issue Type: New Feature
>          Components: PDModel
>    Affects Versions: 2.0.28, 3.0.0 PDFBox
>            Reporter: Stefan Ziegler
>            Priority: Minor
>         Attachments: PDDocument.java.patch
>
>
> Please add the following method to PDDocument:
>  
> {code:java}
> public void save(COSWriter writer){code}
>  
> Why?
> This gives us the possibility to use a custom COSWriter when saving the PDF 
> file. Inside the custom COSWriter we can add some checks and convert some 
> data structures if required.
>  
> Patch is attached.
>  



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to