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)