hi
I try to merge several PDF files into one, and each file can have its own format : A4L, A4P, A3L, A3P, A1 or A0, and some may even have a strange square-like format, mainly because it's been PDF converted from a PNG I guess.
when the individual file has a "standard" format, everything goes to plan, and the final PDF shows each page the way it's intended : it goes from P to L without trouble.
but when there's a "strange" format, it seems that the merge cannot find what to do with it, and keeps the last know format, from the previous merged file, and it results in some truncated page, with huge white borders.
original :
merged :
I tried two ways for the merge, the automatic one ("source" containing the source files in string):
PdfLoadedDocument finalDoc = new PdfLoadedDocument(fileName);
PdfDocument.Merge(finalDoc, source.ToArray());
and the manual one :
PdfLoadedDocument finalDoc = new PdfLoadedDocument(fileName);
PdfDocument.Merge(finalDoc, source.ToArray());
foreach (var docToAppend in source)
{
PdfLoadedDocument append = new PdfLoadedDocument(docToAppend);
finalDoc.Append(append);
append.Close(true);
}
and the result is the same.
I've tried to search in the properties of the PDFLoadedDocument object at runtime, and find nothing containing the format of the file, so I'm pretty much stuck.
any ideas ?
thanks
Hi Pain,
Based on your update, we suspect the page size is changed after merging the different-sized PDF documents. And we have tried to reproduce the issue on our end with test documents and we could not reproduce the reported issue. So we request you to share the simple sample, input and output PDF files with the exact issue details, it would be more helpful for us to analyze further.
Regards,
Irfana J
hi,
thank you for your answer.
here's a zip file containing the 2 individual pdfs you can see on my screenshots.
this is all part of a much much bigger C# solution, I'll try to create a small sample solution if you still can't replicate the problem with the two files provided.
Hi PAIN,
We have tried to reproduce the reported behavior with the provided details on our end but it is working properly. we have attached the sample for your reference. Please try this on your end and let us know the result.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/CreatePDFSample717319772
If you are still facing the issue, we request you share the modified sample, product version with us. so that will be helpful for us to assist you further in this.
Regards,
Irfana J.
sorry, I didn't see your reply at the time and forgotten about this topic ^^
I'll have a look at it and come back to you.
thanks again.
hi
I've tried your sample and it works well.
I'll have to see why it keeps doing this in my (huge) solution.
thanks.
Click the Select files button above or drag and drop files into the drop zone.
Select the files you want to merge using the Acrobat PDF combiner tool.
Reorder the files if needed.
Click Merge files.
Download the merged PDF. Sign in to organize individual pages or share the file.
Hope You Find This Useful,
Peter
Thank you for your suggestion