Forums

Skip Navigation LinksHome  /  Support  /  Forums  /  DynamicPDF Merger for .NET (v4.x)  /  Avoid extract shared images if they are not in use

Forum Thread - Avoid extract shared images if they are not in use

Our PDF file has a lot of share images as reference in the pdf file, when we extract just a few pages, all the shared images are also brought into the new pdf files. It make file size almost as large as the original pdf file.  Is there any way we can avoid extract images if they are not in use?
Posted by a ceTe Software moderator
Hello,

Please email the following information to support@cete.com so we can look into this further.

1. Source PDF file.
2. Code used to extract pages from the source PDF.
3. Output PDFs generated after extracting pages from source PDF.
4. Version and build of the DynamicPDF dll used. (A screenshot of the Details tab of the dll file Properties window contains this info)
 
Thanks,
ceTe Software Support Team
Thank you very much for your quick reply.  The following are the sample code we use to extract pages. version is 8.0.1.40, run time version is v4.0.30319. it is 32 bit.
Our PDF is highly confidential, and can not provide them.  sorry about that.

doc = new PdfDocument(Path.Combine(workFolder, fileNameWithExtension));
MergeOptions options = new MergeOptions(true);
options.Outlines = false;
MergeDocument firstPdf = new MergeDocument(doc, start, end - start + 1, options);
firstPdf.Draw(Path.Combine(splitFolder,outlines[i].Text.Split(':')[1].Trim() + ".pdf"));
Posted by a ceTe Software moderator
Hello,

We would need to look at the PDF in order to understand the issue with the shared images and to accurately answer your question. In any case, you may try the following suggestions and see if they help:

1. Update the dll to the latest (v8.0.4) as you are using an old build. You can download the latest installer in the customer area.

2. Try the code suggested in “Combining Images” listed here. The code shows how to use DocumentOptimization class, this class will only remove duplicate image objects if any present. It probably won’t remove the shared images you are talking about.

Thanks,
ceTe Software Support Team.
Thanks for your suggestions,  could you please let us know how to upload pdf file in the forum so that you can take a look at the file?

Thanks
Larry
I tried  Stripping Unneeded Content using the following code, even I extract on or two pages,  the file size is  almost the same as whole file size.
we really appreciate your  support.
thanks
Larry
MergeOptions mergeOptions = new MergeOptions();
mergeOptions.LogicalStructure = false;
mergeOptions.Outlines = false;
mergeOptions.DocumentJavaScript = false;
mergeOptions.EmbeddedFiles = false;
MergeDocument document = new MergeDocument(@"C:\Document.pdf", mergeOptions);
document.Draw(@"C:\MyDocument.pdf");
Posted by a ceTe Software moderator - Commonly asked question
Hello Larry,

Please send an email to support@cete.com with the PDF as attachment. Include the url of this forum post in your email.

Thanks,
ceTe Software Support Team 
Posted by a ceTe Software moderator
Hello,

After reviewing the PDF, it has been found that the file size of the extracted PDF is remaining the same as the original PDF due to hundreds of form objects being referenced in each page of the original PDF. Our product can remove duplicate image objects if any present in the PDF, but our product is not capable of removing form objects.

Thanks,
ceTe Software Support Team

All times are US Eastern Standard time. The time now is 9:07 AM.