Zoom document while merge PDF file with ASPOSE.PDF

Hi Suppoet,

We are merging multiple PDF files into one PDF and upload the same in azure blob storage. It’s wotking fine for most cases but we observed that in some cases PDF merged with zoomed content so its extrimly diffecult to read ot even view the content.

We are using below code to achive the funcationality.

foreach (var fileItem in fileList)
{
string fileType = Path.GetExtension(fileItem).Replace(“.”, “”);
if (fileType == Enumeration.FileType.PDF.ToString().ToLower())
{
MemoryStream fileStream = await _blobStorageHelper.DownloadBolbDocumentAsync(fileItem, Entity.Load.ToString().ToLower());

                    Document pdfDocument = new Document(fileStream);
                    invoiceDocument.Pages.Add(pdfDocument.Pages);
                }
            }

            //Set Page size to legal
            PageCollection pageCollection = invoiceDocument.Pages;
            foreach (var item in pageCollection)
            {
                item.SetPageSize(PageSize.PageLegal.Width, PageSize.PageLegal.Height);
            }
            invoiceDocument.SetTitle(Constants.Constants.InvoicePDF);


            using (MemoryStream ms = new MemoryStream())
            {
                invoiceDocument.Save(ms);
                DocumentViewModel documentViewModel = new DocumentViewModel();
                documentViewModel = await _blobStorageHelper.UploadAsync(Constants.Constants.BlobContainerName, EnumUtils.StringValueOf(DocumentType.Invoice), null, ms);
                documentModel.Name = documentViewModel.Name;
                documentModel.DocumentPath = documentViewModel.DocumentPath;
            }

ASPOSE_Merge_zoom_issue.png (40.5 KB)

In screenshot you can see that page 2 is zoomed. We have also attached screenshot of original pdf so that you can compare output of merged PDF.
Original page 2.jpg (257.6 KB)

We have tried and search multiple options but unable to figure out above mentioned issue. Can you please help us to resolve the issue.

apologies for not uploading original document due to contractual limitations.

Thanks in advance.

@devashish55

Would you please ensure that you are using the latest version of the API i.e. 24.4? Also, we do need sample PDF documents in order to replicate the issue in our environment. We assure you that we only use them for testing purposes and remove from our system once the investigation is done. Please provide sample files so that we can try to replicate the issue in our environment and address it accordingly.

Sure @asad.ali

As discussed. We have attached PDF document herewith.

Input -
POD_1004806.pdf (712.1 KB)

Output -
2500314 (1).pdf (842.5 KB)

In above document you can see that input document is merged in zoomed format in output document, which is an issue. Please let us know in case of any further information required.

Thanks,

@devashish55

We were able to replicate the issue in our environment using 24.4 and the below code snippet:

var doc1 = new Document();
doc1.Pages.Add();
var doc2 = new Document(dataDir + "POD_1004806.pdf");

doc1.Pages.Add(doc2.Pages);
doc1.Save(dataDir + "mergedpdfs.pdf");

We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFNET-57163

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

@asad.ali Hello,

Is there any progress on this as our client is facing above mentioned issue which impacting day to day business operations?

Thanks in advance.