Can you point me to documentation describing how to open, compress, and save an existing PDF?
Also when I link source code on the forum, how do I enable the syntax highlighting like you guys do when you reply?
Can you point me to documentation describing how to open, compress, and save an existing PDF?
Hi Robert,robert.kerr:Can you point me to documentation describing how to open, compress, and save an existing PDF?
robert.kerr:Also when I link source code on the forum, how do I enable the syntax highlighting like you guys do when you reply?
Thanks. What size PDF can optimize handle? I’m sending PDFs of only 16 MB at it and it throws out-of-memory exceptions.
It’s the RemoveUnusedStreams option. If set to false, no out-of-memory exception.
Please take a look over following image.robert.kerr:Thanks. What size PDF can optimize handle? I’m sending PDFs of only 16 MB at it and it throws out-of-memory exceptions.VS2015 update 3Aspose.Pdf .NET 11.9private static void Shrink(string sourceFilename, string targetFilename){try{var pdfDocument = new Document(sourceFilename);pdfDocument.OptimizeResources(new Document.OptimizationOptions(){LinkDuplcateStreams = true,RemoveUnusedObjects = true,RemoveUnusedStreams = true,CompressImages = false,ImageQuality = 10,UnembedFonts = false,});pdfDocument.Save(targetFilename);}catch (Exception ex){Console.WriteLine($" FAIL: {ex.Message}");}}If I remove the Optimization section, and just Open then Save, the resulting PDFs are larger than the originals.var pdfDocument = new Document(sourceFilename);Hi Robert,pdfDocument.Save(targetFilename);Thanks for the acknowledgement.There is no limitation in terms of PDF size and the reasons you are facing this problem, might be related to the structure and complexity of input document.We have been using all parameters for Optimization and did not notice any issue. However in order to resolve this problem, we need your input document, so that we can further look into this matter.robert.kerr:I cannot share the PDFs because of HIPAA.
For your convenience, I have marked this forum thread as private, so that the contents shared in this thread are only accessible to Aspose staff. Please note that the documents share by our customers are only used for testing purposes and once a particular issue is resolved, they are removed from our system.robert.kerr:p.s. I don’t see an “insert code snippet” button on the toolbar above the editor.
When I click “Quick Reply”, I don’t get the last two buttons, or the My Messages dropdown.
Hi Robert,robert.kerr:When I click “Quick Reply”, I don’t get the last two buttons, or the My Messages dropdown.
In order to share the snapshot/image, please try using Add/Update button under File attachment label.robert.kerr:Also, I tried to attach a screenshot, but when I click the “picture” button, for Content Selector, then click on either “Files” or “Pictures”, chrome throws an “error loading callback”.
robert.kerr:As for the PDF, I’ll need to find a tool that can anonymize it, removing HIPAA text. Suggestions? Something to replace string A with string B would be fine, if it didn’t otherwise alter the document.
Hi,
In order to replace text inside PDF file, please follow the instructions specified over Replace Text in a PDF Document