Spire.PDF is a professional PDF library applied to creating, writing, editing, handling and reading PDF files without any external dependencies. Get free and professional technical support for Spire.PDF for .NET, Java, Android, C++, Python.

Tue Feb 06, 2024 8:51 pm

Hello, I am testing Spire.pdf (10.2.2) in an azure function app (Vs 2022).
The function merges the files I need for most files but I have a file when added to the merge that throws the error. "System.Private.CoreLib: Exception while executing function: MergePDF. Spire.Pdf: The start index is greater then the end index."

sdoherty
 
Posts: 5
Joined: Thu Sep 21, 2017 2:14 pm

Wed Feb 07, 2024 1:26 am

Hello,

Thank you for your inquiry.
In order to help us investigate your problem quickly and efficiently, please provide us with sample PDF documents that reproduce your issue and complete test code for our reference. You could attach them here or send them to us via email ([email protected]). Thanks in advance.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Tue Feb 27, 2024 6:09 pm

Please use the two docs in the zip file.
The erro happens when i try to append.
I can do many other docs but something with the doc that ends with Shipping_Instructions that always makes it fail.


PdfDocument[] docs = new PdfDocument[2];
foreach (var filePath in queueItem.FilesPathArray)
{
// get file from SharePoint
file = ctx.Web.GetFileByUrl(filePath);
fileStream = file.OpenBinaryStream();
ctx.Load(file);
await ctx.ExecuteQueryRetryAsync();
docs[i] = new PdfDocument(fileStream.Value);
i++;
}

for (int x = 1; x < i; x++)
{
docs[0].AppendPage(docs[x]);
}

sdoherty
 
Posts: 5
Joined: Thu Sep 21, 2017 2:14 pm

Wed Feb 28, 2024 1:54 am

Hello,

Thank you for providing detailed information regarding the issue.
I have tested the PDF file "SH096524_Shipping_Instructions.pdf" that you shared and was able to replicate the problem you mentioned. Upon investigation, I found that the file fails to open correctly when viewed using Adobe Viewer, indicating an issue with the document's structure. Can you confirm if you are able to view this PDF file successfully on your end? Additionally, could you please let us know which PDF viewer you are using for viewing the document?

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Wed Feb 28, 2024 12:44 pm

Hello,

These usually sit on SharePoint so I am opening them in the edge browser and it opened for me.
Screenshot attached. If there is a structure problem as you say, what does that mean?
How would that be solved, not sure how to fix the 'structure' of a PDF.

sdoherty
 
Posts: 5
Joined: Thu Sep 21, 2017 2:14 pm

Thu Feb 29, 2024 1:29 am

Hello,

Thank you for your feedback.
Following your feedback, after conducting a detailed investigation, I have found that the file "SH096524_Shipping_Instructions.pdf" can be correctly opened and viewed in Foxit Reader and browsers. I have escalated this issue to our development team for further investigation on compatibility, and the assigned issue number is SPIREPDF-6571. I will keep you promptly informed once we receive any updates from the development team.
I apologize for any inconvenience this may have caused. Should you have any further questions or concerns, please feel free to reach out to me.
Thank you for your understanding and patience.

Sincerely,
Annika
E-iceblue support team
User avatar

Annika.Zhou
 
Posts: 1657
Joined: Wed Apr 07, 2021 2:50 am

Mon Mar 18, 2024 7:39 pm

I am also getting the error on the following file. This one opens fine in all viewers.
Can this be escalated as this is really impeding using the product at this point.

sdoherty
 
Posts: 5
Joined: Thu Sep 21, 2017 2:14 pm

Tue Mar 19, 2024 1:31 am

Hello,

Thanks for your following up.
I have attached this new file to the ticket SPIREPDF-6571, and our dev team will further investigate. If there is any progress, I will notify you as soon as possible.

Sincerely,
William
E-iceblue support team
User avatar

William.Zhang
 
Posts: 757
Joined: Mon Dec 27, 2021 2:23 am

Return to Spire.PDF

cron