Spire.PDFViewer is a powerful PDF Viewer component for .NET. It allows developers to load PDF document from stream, file and byte array.

Tue Nov 06, 2012 1:57 pm

hi, I'm testing your trial version and I've a first question for you: how get page size of an existing loaded pdf?
I'm working on Wpf and I don't want to show hole page and I don't want to see scroll bars.
How can I do it?


thanks

lucaparenti
 
Posts: 1
Joined: Wed Oct 31, 2012 5:37 pm

Wed Nov 07, 2012 3:33 am

Hi lucaparenti,

Thanks for your inquiry.
We are sorry that we don't support getting page size of an existing loaded pdf at present, we will add the functionality into spire.pdfViewer as soon as possible, once have any progress on it, we will inform you immediately. Now you can try to use below method to improve your previous result.
Code: Select all
 private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            if (File.Exists(pdfFileName))
            { 
                this.pdfDocumentViewer1.LoadFromFile(pdfFileName);
                pdfDocumentViewer1.SetZoom(Spire.PdfViewer.Wpf.ZoomMode.FitPage);
            }
        }
   private void pdfDocumentViewer1_SizeChanged(object sender, SizeChangedEventArgs e)
        {
            pdfDocumentViewer1.SetZoom(Spire.PdfViewer.Wpf.ZoomMode.FitPage);
        }


Best regards,
Amy
E-iceblue support
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Thu Nov 29, 2012 9:04 am

Hi lucaparenti,

Thanks for you waiting.
We have added the method getting page size of an existing loaded pdf. Please download Spire.PDFViewer Pack Version:1.6.7 from the link http://www.e-iceblue.com/Download/downl ... t-now.html.
About the requirement on scroll bars, our dev team do some improvements for the internal code of Spire.pdfViewer. We provide you with a demo. We use the dlls in bin/ WPF4.0 of Spire.PDFViewer Pack Version:1.6.7. Please try it. Please first use SinglePage method, and then use FitPage method when you run the demo. We provide you a screnshot to show you these two methods in the demo. If you still have the problem, please tell us.
About the requirement on hole page, we don't completely understand it, could you please provide us with a sample file to show us no hole page? Thank you!

Code: Select all
this.pdfDocumentViewer1.GetPageSize(pageIndex);


Have a nice day!

Best regards,
Amy
E-iceblue support
User avatar

amy.zhao
 
Posts: 2766
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.PDFViewer