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

John Hewson commented on PDFBOX-2765:
-------------------------------------

{quote}
Thank you, your questions answered by need. I am doing this for existing PDFs. 
Therefore, presumably, I wont need font subsetting. I only saw the subsetting 
code in the save() method, and assumed I was missing it.
{quote}

Ok, I'll close this issue as you don't require subsetting.

{quote}
John, its not only about compress, but also remove duplicates. PD API does not 
have a visitor pattern, so I would need to know how to descend. Even COS 
visitor does not descend for me/does not have a descending implementation. My 
limited knowledge would be sure to introduce bugs.

Also, how better to check for duplicates, including duplicate graphs of related 
objects, than to coswrite the object and all dependencies and checksum the 
output?
{quote}

Sorry, what I actually had in mind was the COS model, because it's much easier 
to walk. You can start from document.getDocumentCatalog().getCOSObject() and 
walk the entire document. I'd recommend figuring out where your compression is 
actually coming from, it's probably going to be duplicate streams, in which 
case you can just build a map of COSStream objects and hash their contents.

> Add method to subset fonts for document pre-save
> ------------------------------------------------
>
>                 Key: PDFBOX-2765
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-2765
>             Project: PDFBox
>          Issue Type: New Feature
>          Components: Writing
>    Affects Versions: 2.0.0
>            Reporter: Jesse Long
>            Assignee: John Hewson
>            Priority: Minor
>
> I have a custom COSWriter which compresses all streams and runs a SHA1 sum 
> over each object, only writing one instance of each object with the same SHA1 
> sum.
> This really helps compress PDFs.
> I use this by calling MyCustomCOSWriter.write(PDDocument);
> The trouble is that I have no way of calling the font subsetting that happens 
> in PDDocument.save(). 
> Could we have a method to perform that font subsetting manually?



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org

Reply via email to