PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index PDFsharp - moved to http://forum.pdfsharp.net/
Please visit the new PDFsharp forum at http://forum.pdfsharp.net/
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Token '' was not expected

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/
View previous topic :: View next topic  
Author Message
chris1411



Joined: 19 Dec 2008
Posts: 2
Location: WV

PostPosted: Fri Dec 19, 2008 8:19 pm    Post subject: Token '' was not expected Reply with quote

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
View user's profile Send private message
chris1411



Joined: 19 Dec 2008
Posts: 2
Location: WV

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

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
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    PDFsharp - moved to http://forum.pdfsharp.net/ Forum Index -> Support - moved to http://forum.pdfsharp.net/ All times are GMT
Page 1 of 1

 
Jump to:  
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 vote in polls in this forum


Powered by phpBB © phpBB Group. Hosted by phpBB.BizHat.com


Start Your Own YouTube Clone

Free Web Hosting | Free Forum Hosting | FlashWebHost.com | Image Hosting | Photo Gallery | FreeMarriage.com

Powered by PhpBBweb.com, setup your forum now!
For Support, visit Forums.BizHat.com