PDFsharp & MigraDoc Forum
https://forum.pdfsharp.net/

PDFsharp Token '' was not expected.
https://forum.pdfsharp.net/viewtopic.php?f=2&t=2168
Page 1 of 1

Author:  ronyz [ Wed Oct 17, 2012 9:31 pm ]
Post subject:  PDFsharp Token '' was not expected.

Hi,
i am using pdfsharp.dll to merge pdf documents. Everything seemed to be working until we started merging pdf documents obtained from scanned documents using personnal scanners.
The error is Token '' was not expected.
I tried the following: print the pdf document using pdfcute, then try to merge the resulting print pdf. and it works fine.
It is not an option for us to change scanners :) !!!
Did anyone face this issue??? Any solution would be really appreciated.

below is the code i am using (the 2 files are stored in sharepoint):


Stream Stream2 = spfile2.OpenBinaryStream();
Stream Stream1 = spfile1.OpenBinaryStream();
PdfDocument outputDocument = PdfReader.Open(Stream1,PdfDocumentOpenMode.Modify);
PdfDocument inputDocument = PdfReader.Open(Stream2, PdfDocumentOpenMode.Import);
int count = inputDocument.PageCount;
for (int idx = 0; idx < count; idx++)
{
PdfPage page = inputDocument.Pages[idx];
outputDocument.AddPage(page);
}

outputDocument.Save(Stream1, false);
spfile1.SaveBinary(Stream1);
spfile1.Update();
Stream1.Close();
Stream2.Close();
outputDocument.Dispose();
inputDocument.Dispose();

Author:  Thomas Hoevel [ Thu Oct 18, 2012 8:15 am ]
Post subject:  Re: PDFsharp Token '' was not expected.

Hi!
ronyz wrote:
Any solution would be really appreciated.
There is nothing we can do without a PDF file that causes this error message.
Confidential PDF files can be submitted via e-mail (or just scan something that is not confidential).

Page 1 of 1 All times are UTC
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/