I'm trying to merge documents who's paths are found in a ListBox control. When I tried to append to the merge document, I get this error. Any ideas on why this is happening?
System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file
Re: System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file
Forum member · Mar 23, 2006As if that's not bad enough, when I try this code:
Dim doc As MergeDocument = MergeDocument.Merge("C:\Inetpub\wwwroot\intranet\submittals\documents\Items Sent With All Submittals\Company Information Sheet.pdf", "C:\Inetpub\wwwroot\intranet\submittals\documents\Items Sent With All Submittals\Company Information Sheet.pdf")
I get an adobe error that says the file is damaged and can't be fixed. What's the deal?
Re: System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file
Support · Mar 23, 2006It looks like some of the PDFs that you are attempting to merge in are invalid or corrupt. can you send over the PDF documents that you are using ("Company Information Sheet.pdf" and which ever PDF you are using to create the error above) to [^a|mailto:support@cete.com|support@cete.com^]. From there we can take a look at them and see if we can determine the problem. Also in your email can you include the stack trace for the Exception above?
Thanks,
ceTe Software Support Team
Re: System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file
Forum member · Mar 24, 2006I solved the problem with the IO exception. Somehow a .doc file got placed in the directory and I unknowingly was adding it to the list repeatedly.
The issue with the damaged file not opening only occurs when I use the DrawToWeb method. When I just use Draw and specify a file path, it saves the file perfectly and I can open it just fine.
Re: System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file
Support · Mar 24, 2006Hello,
The most likely reason you are getting the damaged file not opening error is because there might some HTML being output after the PDF corrupting the PDF output stream. The easiest solution would be to add a Response.End() immediately after the DrawToWeb() method and that should fix your problem.
Thanks,
ceTe Software Support Team
Re: System.IO.IOException: An attempt was made to move the file pointer before the beginning of the file
Forum member · Mar 24, 2006That fixed it. Thanks a lot!