Document object

Document object

Forum member · Aug 1, 2007
I have a page that extends the DplxWebForm object. Is there any way to get access to the document.ViewerPreferences from this.DocumentLayout? Or any other method? I would like to be able to control some of the ViewerPreferences, but not have to hand code the pages by creating a document object. Or is there an interface that I can use to get access to those? Thanks, Mike

Re: Document object

Support · Aug 1, 2007
Hello Mike, If you want to get access to the Document object, you will have to extend your page not from DplxWebForm but System.Web.UI.Page and then use the sample code below: DocumentLayout report = new DocumentLayout( filePath ); Document document = report.Run(); Document.ViewerPreferences.FitWindow = true; document.Draw(@"C:\Temp\report.pdf"); Thanks, ceTe Software Support Team

Re: Document object

Forum member · Aug 1, 2007
Using your code, I was able to tweak it to work for my web page: DocumentLayout report = this.DocumentLayout; Document document = report.Run(); document.InitialPageZoom = PageZoom.FitWidth; Now, without altering the aspx.cs file, I can still get the benefits of extending DplxWebForm, and having access to the document object. One thing though, when I set the PageZoom to fitwith, it moves the document to the end of hte page. Is there a way to make/force the page to start at the top? If not, I think this might be a bug, as I can't see anyone wanting to stretch it out to fit the page, and start at the bottom of the page. Thanks, Mike

Re: Document object

Support · Aug 1, 2007
Hello Mike, What version of Acrobat are you using to view the PDF. This is definitely not the desired behavior. Thanks, ceTe Software Support Team

Re: Document object

Forum member · Aug 1, 2007
I'm using version 8.1 in IE 6.0

Re: Document object

Support · Aug 2, 2007
Hello Mike, We are unable to recreate the behavior which you are getting. We have used the exact code as the one you posted and we are using the Acrobat Reader 8.1 and IE6. We are able to see the PDF opened from the top without any problem. Thanks, ceTe Software Support Team.

Re: Document object

Forum member · Aug 2, 2007
Hmmm. I forgot one item, it is in an iframe, inside another page, but i wouldn't think that would make much of a difference. I'll test it on another system to see if it is my computer. Thanks, Mike