We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to split pdf file into multiple files ??

Thread ID:

Created:

Updated:

Platform:

Replies:

145708 Jul 4,2019 03:22 PM UTC Apr 8,2021 05:00 PM UTC ASP.NET MVC - EJ 2 5
loading
Tags: PDF Viewer
Mootaz Abdellatif
Asked On July 4, 2019 03:22 PM UTC

I'm trying to create a pdf viewer page with split options, I want to upload a pdf file and split into multiple pdf files.
I already used syncfusion to create pdf viewer sample but the issue now is that i cant split it into multiple pdf files !!! 
Are there any samples that can be helpful ?? 
Thank you.

Ramya Thirugnanam [Syncfusion]
Replied On July 5, 2019 06:19 AM UTC

Hi Mootaz, 
 
Thanks for contacting Syncfusion support. 
 
At present, PDF Viewer control does not support splitting of a PDF document into multiple files. However, we can achieve this by using Syncfusion PDF library in the code behind of the application. Please find the documentation link for splitting the document into multiple files using Syncfusion PDF library below. 
 
 
Could you please confirm us whether your requirement is to split the pages in the UI of the PDF Viewer control or in the code behind of the application? It will be helpful for us to analyze further and assist you better. 
 
Regards,  
Ramya T 


Mootaz Abdellatif
Replied On July 5, 2019 07:55 AM UTC

Hi Ramya T,
Thank you for your help.
I'm actually trying to split the pages in the UI of the PDF viewer control and not in the code behind the application.
If there is an API or library other than PDF Viewer control to split the pages in the PDF please inform me, that could be very helpful.
Regards
Mootaz A



Ramya Thirugnanam [Syncfusion]
Replied On July 5, 2019 10:29 AM UTC

Hi Mootaz, 
 
Thank you for your update. 
 
At present, EJ2 PDF Viewer control does not support splitting the PDF pages into multiple files. Can you please confirm us whether you are trying to split the pages like in the Acrobat PDF Viewer? However, we have added this feature to our features request list. It can be tracked through our feature management system. 
 
 
We do not have immediate plans to implement this feature. This feature will be available in any of our upcoming releases. 
 
Regards,  
Ramya T 


Venkat
Replied On April 7, 2021 11:05 AM UTC

Hi Mootaz, 
 
Thank you for your update. 
 
At present, EJ2 PDF Viewer control does not support splitting the PDF pages into multiple files. Can you please confirm us whether you are trying to split the pages like in the Acrobat PDF Viewer? However, we have added this feature to our features request list. It can be tracked through our feature management system. 
 
 
We do not have immediate plans to implement this feature. This feature will be available in any of our upcoming releases. 
 
Regards,  
Ramya T 


HI  All,

Below Refence code  i am using asp.net core 3.1 but facing some reference issue ,like below

PdfDocument' does not contain a definition for 'ImportPage' and no accessible extension method 'ImportPage' accepting a first argument of type 'PdfDocument' could be found (are you missing a using directive or an assembly reference?) .net core

https://www.syncfusion.com/blogs/post/6-easy-ways-to-split-a-pdf-document-using-c.aspx


https://help.syncfusion.com/file-formats/pdf/working-with-pages?cs-save-lang=1&cs-lang=asp.net%20core

Kindly share the details
 

Vasugi Sivajothi [Syncfusion]
Replied On April 8, 2021 05:00 PM UTC

Hi Venkat, 
 
The PDF document can be split into individual pages or a range of pages using ImportPage method as shown in below code snippet in .Net core platform.  Please refer the below code snippet,  
//Load the PDF document.  
            FileStream docStream = new FileStream(DataPathBase + "Sample.pdf", FileMode.Open, FileAccess.Read);  
  
            PdfLoadedDocument loadedDocument = new PdfLoadedDocument(docStream);  
  
            for (int i = 0; i < loadedDocument.PageCount; i++)  
             
  
                //Creates a new document  
  
                PdfDocument document = new PdfDocument();  
  
                //Imports the pages from the loaded document  
  
                document.ImportPage(loadedDocument, i);  
  
                //Create a memory stream   
  
                MemoryStream stream = new MemoryStream();  
  
                //Save the document to stream  
  
                document.Save(stream);  
  
                stream.Position = 0;  
  
                //Close the document  
  
                document.Close(true);  
  
                //Create a file stream  
  
                FileStream fileStream = new FileStream(DataPathOutput + "ImportPage_Output"+ i + ".pdf", FileMode.Create, FileAccess.Write);  
  
                byte[] bytes = stream.ToArray();  
  
                //Write bytes to file  
  
                fileStream.Write(bytes, 0, (int)bytes.Length);  
  
                //Dispose the streams  
  
                stream.Dispose();  
  
                fileStream.Dispose();  
  
             
   
We have created a sample for the same and this can be found in below link:    
  
  
Kindly try the same and let us know if you need any further information on this.     
  
Regards, 
Vasugi 
 
 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon