132
Views
4
Comments
PDF page split based on Image
Question

Hello, 

I need to find a particular image in PDF (i.e X Mark). If that image is found then my PDF page count should end and split the file.

Eg:- I have a PDF file that has 10 pages. The 6th page of PDF contains image (X), so it has to split pages 1 to 5 and save as the file Page 1 to 5.pdf. Remaining 7 to 10 pages should again split and save as Page 7 to 10.pdf

Below is the image (X) for your reference.

Regards,

Vinod

2018-09-27 18-20-33
Swatantra Kumar
Champion

Hi Vinod,

It sounds more of the application logic. During preparation of the page split the content into two different DOM elements, based on the subjected image. Just before processing of the pdf file, you may would like to implement the logic to send the contents (InnerHTML) of these two DOM elements separately for two different PDF files. 

Regards,

Swatantra

2025-10-09 15-40-22
Craig St Jean
Staff

Swatantra Kumar wrote:

Hi Vinod,

It sounds more of the application logic. During preparation of the page split the content into two different DOM elements, based on the subjected image. Just before processing of the pdf file, you may would like to implement the logic to send the contents (InnerHTML) of these two DOM elements separately for two different PDF files. 

Regards,

Swatantra

 Hello Swatantra,

I'm not sure how this helps Vinod's problem.  It sounds like he has a PDF file and needs to try to split the file into multiple files, which has nothing to do with DOM parsing.  Can you elaborate?

 

2025-10-09 15-40-22
Craig St Jean
Staff

Vinod Kumar wrote:

Hello, 

I need to find a particular image in PDF (i.e X Mark). If that image is found then my PDF page count should end and split the file.

Eg:- I have a PDF file that has 10 pages. The 6th page of PDF contains image (X), so it has to split pages 1 to 5 and save as the file Page 1 to 5.pdf. Remaining 7 to 10 pages should again split and save as Page 7 to 10.pdf

Below is the image (X) for your reference.

Regards,

Vinod

 Hello Vinod,

This would probably need to be done using PDF libraries in C# in an extension.  It looks like it can be done with E-IceBlue, but that is a proprietary product (https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/NET-Split-PDF-Simply-Split-PDF-Document-to-Multiple-Files-with-C-VB.NET.html )

You might be able to use PDFSharp or iTextSharp (again noting iTextSharp has license restrictions)

 

2023-03-08 10-32-19
Vinod Kumar R

Craig St.Jean wrote:

Vinod Kumar wrote:

Hello, 

I need to find a particular image in PDF (i.e X Mark). If that image is found then my PDF page count should end and split the file.

Eg:- I have a PDF file that has 10 pages. The 6th page of PDF contains image (X), so it has to split pages 1 to 5 and save as the file Page 1 to 5.pdf. Remaining 7 to 10 pages should again split and save as Page 7 to 10.pdf

Below is the image (X) for your reference.

Regards,

Vinod

 Hello Vinod,

This would probably need to be done using PDF libraries in C# in an extension.  It looks like it can be done with E-IceBlue, but that is a proprietary product (https://www.e-iceblue.com/Tutorials/Spire.PDF/Spire.PDF-Program-Guide/NET-Split-PDF-Simply-Split-PDF-Document-to-Multiple-Files-with-C-VB.NET.html )

You might be able to use PDFSharp or iTextSharp (again noting iTextSharp has license restrictions)

 

 

 Hi Craig,

I have gone through the above link, but this PDF split is based on the page count of the current file.

My problem statement is something different:- The X mark which I mentioned is in image format, so it has to identify the image in the whole PDF. If the image exists then the pages have to be split between those images.

 



Community GuidelinesBe kind and respectful, give credit to the original source of content, and search for duplicates before posting.