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.

Fri Jun 03, 2022 5:41 pm

Hello, I am trying to split pdf which are rotated in different direction. when I process through these pages its not parsing properly. Please see the attached input file and output file. looking forward for solution on this.

Code which I have used for split.

Code: Select all
for (int counter = startPage; counter <= endPage; counter++)
            {
                var sourcePage = sourceFile.Pages[counter - 1];
                if (sourcePage.Size.Width > sourcePage.Size.Height)
                {
                    newPage = outputPdf.Pages.Add(sourcePage.Size, new PdfMargins(0), sourcePage.Rotation, PdfPageOrientation.Landscape);
                }
                else
                {
                    newPage = outputPdf.Pages.Add(sourcePage.Size, new PdfMargins(0), sourcePage.Rotation, PdfPageOrientation.Portrait);
                }

                sourcePage.CreateTemplate().Draw(newPage, new PointF(0, 0));

                if (counter % endPage == 0)
                {
                    outputPdf.SaveToFile($"Test{counter}.pdf");
                    return outputPdf;
                }
            }


would really appreciate the response.

tandeltrushar
 
Posts: 5
Joined: Tue May 31, 2022 12:59 pm

Mon Jun 06, 2022 9:36 am

Hi,

Thank you for your inquiry and sorry for the late reply as weekend.
I did not find your input file and output file on this post, please attach the documents again here or send them to us via email (support@e-iceblue.com). Thanks in advance.

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Mon Jun 06, 2022 8:16 pm

Never mind I found the answer from portal.

https://www.e-iceblue.com/Tutorials/Spi ... -in-C.html

Thanks

tandeltrushar
 
Posts: 5
Joined: Tue May 31, 2022 12:59 pm

Tue Jun 07, 2022 3:57 am

Hi,

If you need assistance in the future, please don't hesitate to contact us.
Wish you a nice day!

Sincerely,
Kylie
E-iceblue support team
User avatar

kylie.tian
 
Posts: 412
Joined: Mon Mar 07, 2022 2:30 am

Return to Spire.PDF