DrawToWeb

DrawToWeb

Forum member · Feb 11, 2008
Hi, I am using dynamic pdf merger v 4.0 to merge existing pdf documents that I have. I am using the following code: I am using treeview control to display files. MergeDocument document = new MergeDocument(); document.Append(node.value); document.DrawToWeb("Output.pdf",true); When I run this code , it opens up a dialog and asks if I want to open or save Output.pdf. when open the file it is giving error "adobe reader could not open output.pdf because it is either not supported file type or because the file name has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)" I am able to open development server without any problem. But when I deploy to production, and try to open, I am getting this error. I am getting this problem with save also. I didn't get this problem v3.0 please suggest me on this one.

Re: DrawToWeb

Support · Feb 11, 2008
Hello, The error you are getting is most probably because of some stray HTML getting outputted along with the PDF stream. Different Editions of Acrobat behaves differently with this stray HTML. Please try adding the following line of code right after the DrawToWeb method of the document object and it will likely solve your problem. document.DrawToWeb("Output.pdf",true); Visible = false; Thanks, ceTe Software Support Team

Re: DrawToWeb

Forum member · Feb 11, 2008
Hi, Still I am getting the same problem.

Re: DrawToWeb

Support · Feb 11, 2008
Hello, We think the problem could be related to the headers not getting set correctly. We will need to take a look at the headers from the page calling the PDF document. We recommend using ieHTTPHeaders tool which allows you to capture all IE headers. Run your example once again and send us the headers it returns. It's free to download. Following is the link: ieHTTPHeaders . Thanks, ceTe Software Support Team

Re: DrawToWeb

Forum member · Mar 25, 2008
Hi guys, I am getting the exact same error. Any news on this matter?

Re: DrawToWeb

Forum member · Mar 25, 2008
For clarity: Document document = new Document(); ceTe.DynamicPDF.Page page = new ceTe.DynamicPDF.Page(); page.Elements.Add(new Label("Hello World!", 0, 0, 100, 12, Font.Helvetica, 12)); document.Pages.Add(page); document.DrawToWeb("Test.pdf"); This fails to create a valid pdf document. document.Draw(@"c:\test.pdf") does work however. Regards, Jim

Re: DrawToWeb

Support · Mar 25, 2008
Hello Jim, The reason for this error you are getting is most probably because of some stray HTML getting outputted along with the PDF stream. Please try adding the following line right after the DrawToWeb method of the document. Visible = false; If you are still getting this error then we will need to look at the http headers returned by the page calling the PDF. We recommend using ieHTTPHeaders tool which allows you to capture all IE headers. Run your example once again and send us the headers it returns. Following is the link: ieHTTPHeaders . Thanks, ceTe Software Support Team.

Re: DrawToWeb

Forum member · Mar 25, 2008
Hi, This does seem te work! Great! I will experiment further with the PDF generation. Regards, Jim

Re: DrawToWeb

Forum member · Mar 25, 2008
P.S. Are you working on a solution in stead of a work around? Setting visible to false is not something I prefer, since I would like to show the report on my webpage as well. Regards, Jim

Re: DrawToWeb

Forum member · Mar 25, 2008
P.S. Are you working on a solution in stead of a work around? Setting visible to false is not something I prefer, since I would like to show the report on my webpage as well. Regards, Jim

Re: DrawToWeb

Support · Mar 25, 2008
Hello Jim, The stray HTML on your page that gets added to the content stream will cause this error. There is nothing in our product causing this. In order to stop this stray HTML from getting added, you will have to use the Visible = false; line after the DrawToWeb method. Thanks, ceTe Software Support Team.

Re: DrawToWeb

Forum member · Mar 25, 2008
I noticed this when I didn't set the visible property to false. I now fully understand the problem and I have found a way to avoid it. My customers can now select whether they want the report on screen, in a file or as a PDF. It works great. Thanx for your quick replies! Jim