Splitting PDF documents

Discussions about PDF management.
Post Reply
ebbiTeam
Posts: 20
Joined: Fri May 13, 2011 3:49 pm

Splitting PDF documents

Post by ebbiTeam » Tue Jun 28, 2011 3:56 pm

Hello,

is there any chance to get particular pages of a loaded pdf document in a memorystream or at least in a file.
The documentation mentions "...PDF creation, PDF edition, split, merge, compress..." and I can't find a functionallity like this.
In our implementation we need to merge single pages of a document and save them in their original state...so searchable pdfs should be preserved.
For this reason the image rasterization process is not suitable.
Do you have any idea how to solve this issue?

Best regards
Tobias Herold

User avatar
Loïc
Site Admin
Posts: 5594
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Splitting PDF documents

Post by Loïc » Tue Jun 28, 2011 4:10 pm

Hi Tobias,

Easy to do. You need to use the clone method. Here a snippet:

Code: Select all

      Dim src_pdf As New GdPicturePDF
      Dim new_pdf As New GdPicturePDF

      src_pdf.SetLicenseNumber("XXX")

      src_pdf.LoadFromFile("C:\GdPicture.NET8.pdf", False)
      new_pdf.NewPDF()
      new_pdf.ClonePage(src_pdf, 10)

      Dim memory_stream As New IO.MemoryStream
      new_pdf.SaveToStream(memory_stream)'save the pdf to stream
      new_pdf.SaveToFile("c:\dumppage.pdf") 'save the pdf to file
let me know if you need more information.

Loïc

ebbiTeam
Posts: 20
Joined: Fri May 13, 2011 3:49 pm

Re: Splitting PDF documents

Post by ebbiTeam » Tue Jun 28, 2011 4:37 pm

Great! That's all I need, thank you so much.

User avatar
Loïc
Site Admin
Posts: 5594
Joined: Tue Oct 17, 2006 10:48 pm
Location: France
Contact:

Re: Splitting PDF documents

Post by Loïc » Tue Jun 28, 2011 4:58 pm

You are welcome,

We will provide a buch of snippets really soon that demonstrate several scenarios of usage.

Kind regards,

Loïc

Gabriela
Posts: 47
Joined: Wed Nov 22, 2017 9:52 am

Re: Splitting PDF documents

Post by Gabriela » Wed Nov 22, 2017 12:09 pm

Here you can find updated code snippet based on GdPicture.NET 14:

Splitting PDF documents by number of pages
http://guides.gdpicture.com/content/web ... ages.html
Kind regards,

Gabriela
GdPicture Team

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests