Expand my Community achievements bar.

How to split PDF file by pages

Avatar

Former Community Member
Is there any programming way to split PDF into pages, say one PDF file per page or specify page range to split PDF file?



Thanks for your help.
9 Replies

Avatar

Former Community Member
yes, you can use assembler service and use the ddx to split a pdf into pages

mergeandfuse@gmail.com

Avatar

Former Community Member
<?xml version="1.0" encoding="UTF-8"?>

<DDX xmlns="http://ns.adobe.com/DDX/1.0/">

<PDF result="Final.pdf">

<PDF source="PDF1.pdf" pages="1-3"/>

<PDF source="PDF2.pdf" pages="4-5"/>

</PDF></DDX>



mergeandfuse@gmail.com

Avatar

Former Community Member

Is this code really dissassembling the pdf? Look more like merging two pdfs together.

What if I have a PDF with 10 pages, which I want to split into 10 pdfs - one pdf per page.

Avatar

Level 10

Yes it does. It disassembles pdf1 by extracting pages 1-3 and disassembles pdf2 by extracting pages 4-5. Then re-assembles the two subsets into a new PDF.

You could extract page1 from pdf1 only and create a pdf, then page2 of pdf1 into a different PDF using something similar to:

<?xml version="1.0" encoding="UTF-8"?>
<DDX xmlns="http://ns.adobe.com/DDX/1.0/">
<PDF result="Final.pdf">
     <PDF source="PDF1.pdf" pages="1"/>

</PDF>
<PDF result="Final2.pdf">
      <PDF source="PDF1.pdf" pages="2"/>
</PDF>

</DDX>

You can also use the  PDFFromBookmarks tag to generate a new document for each level 1 bookmark created in a PDF.

<PDFsFromBookmarks prefix="stmt">
     <PDF source="doc1.pdf"/>
</PDFsFromBookmarks>


You can get more info at http://livedocs.adobe.com/livecycle/8.2/ddxRef/000640.html

Jasmin

Avatar

Former Community Member

Great thanks, works perfect! Bookmarks I don´t have, so I will cycle and modify the result and page number in ddx, if possible.

Anyway - how to get number of the pages from docForm variable?

Avatar

Level 8

If you use the docInfo command in the DDX it will return a pile of

info, including the page count


Avatar

Level 1

The Acrobat Javascript can't access the code of a bookmark,so I think we can also use a 3rd party program PDF splitter to split PDF files by pages or bookmark.

Avatar

Level 1

The set of codes offered here is a nice finding of me today, I also think it's a simple way that I can use to <link removed> from the tips I find from Wiki how. Both are worth trying.

Message was edited: for this user, across multiple threads, to remove link promotion

Avatar

Level 1

Hi.If you want to split PDF,i'll suggest you to creat a sample c#project.With .NET imaging SDK,you may easily split PDFfiles by pages