PDFsharp & MigraDoc Forum

PDFsharp - A .NET library for processing PDF & MigraDoc - Creating documents on the fly
It is currently Fri Sep 05, 2025 3:48 am

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules

Also see our new Tailored Support & Services site.



Post new topic Reply to topic  [ 2 posts ] 
Author Message
PostPosted: Fri Dec 19, 2008 8:19 pm 
Offline

Joined: Fri Dec 19, 2008 8:09 pm
Posts: 2
Location: WV
Hi, I have been using PDFSharp for a few days and it has been working great except for one little issue that I can't figure out. I am using it to remove pages from PDF documents. The code I have works fine the first time I run through it on a fresh PDF, but if I try to load the same PDF (that was saved using PDFSharp) a second time to remove more pages, it gives me the error "Token '' was not expected"

Is there something I'm forgetting to set when I save a PDF? Here is some example code I am using that simply removes the first page of a PDF:

Code:
PDFout.Version = PDFin.Version
PDFout.Info.Title = PDFin.Info.Title
PDFout.Info.Creator = PDFin.Info.Creator

For i = 1 To PDFin.PageCount - 1
      PDFout.AddPage(PDFin.Pages(i))
Next

oPDFout.Save(memoryOut)


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Wed Jan 14, 2009 7:54 pm 
Offline

Joined: Fri Dec 19, 2008 8:09 pm
Posts: 2
Location: WV
In case anybody else runs into this problem, it was being cause by this:

memoryOut.GetBuffer()

I change it to memoryOut.ToArray() and it worked fine.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 507 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group