View previous topic :: View next topic |
Author |
Message |
chris1411
Joined: 19 Dec 2008 Posts: 2 Location: WV
|
Posted: Fri Dec 19, 2008 8:19 pm Post subject: Token '' was not expected |
|
|
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) |
|
|
Back to top |
|
 |
chris1411
Joined: 19 Dec 2008 Posts: 2 Location: WV
|
Posted: Wed Jan 14, 2009 7:54 pm Post subject: |
|
|
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. |
|
Back to top |
|
 |
|