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

Thu Nov 12, 2015 3:46 am

Hi,

Thanks for your inquiry.
You can increase PdfViewer's width through this.PdfViewer1.Width.
If you don't set the size of pdfviewer, its size will depend on the size of pdf document.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Thu Nov 12, 2015 11:06 pm

Hi!

I tried to use this.PdfViewer1.Width, but by increasing the width, the pdf hasn't been shown ok, because the pdf is an image. Is the pdf Viewer available with postScript and not like an image?. I also need that the users can select the text of the document, and this isn't possible because the viewer is an image.

Also I proved various sizes (percentage and pixels), and the design of pdfViewer is not responsive. Is it possible change this?. In my case the pdfViewer is embedded in an iframe of Dynamics Crm and I need that the pdfViewer size must be adapted to size of iframe.

Thanks!

Blanquita_84
 
Posts: 44
Joined: Tue Oct 13, 2015 8:58 am

Fri Nov 13, 2015 3:02 am

Hi,

Thanks for your feedback.
I proved various sizes (percentage and pixels), and the design of pdfViewer is not responsive. Is it possible change this?

Would you please provide us with your code to help us replicate it on our side?
Thanks.

I have forwarded your case to our dev team. Our dev team will do an investigation if the pdfViewer size can be adapted to size of iframe. We will tell you when there is any update.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Fri Nov 13, 2015 7:33 am

Hi,

For your requirement that the pdfViewer size must be adapted to size of iframe, how do you want to trigger this event? Click a button? When dragging pdfViewer control in an iframe? or others?

Best Regards,
Amy
E-iceblue support team
User avatar

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

Sun Nov 15, 2015 8:00 pm

Hi,
“For your requirement that the pdfViewer size must be adapted to size of iframe, how do you want to trigger this event? Click a button? When dragging pdfViewer control in an iframe? or others?”

The pdfViewer size must be adapted to size of iframe in the event on load of the page.
We need a viewer similar to the viewer of One Drive. I upload a example a iframe generated with OneDrive

Thanks!

Blanquita_84
 
Posts: 44
Joined: Tue Oct 13, 2015 8:58 am

Mon Nov 16, 2015 3:33 am

Hi,

Thanks for your message.
I have forwarded your requirement to our dev team. We will tell you when there is any update about it.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Wed Nov 18, 2015 8:29 am

Hi,

Thanks for waiting.
Your requirement has been achieved. Please download new version, spire.pdfviewer_2.7.23 and test pdfviewer1.AdaptiveSize(900, 700) function.
Sample code:
Code: Select all
<div style=" width:900px; height :700px; border:2px solid red" >
        <cc1:PdfViewer ID="PdfViewer1" runat="server">
        </cc1:PdfViewer>
        <script type="text/javascript">
            var timeEvent = null;
            function func()
             {
                 if (pdfviewer1 != null) {
                     pdfviewer1.AdaptiveSize(900, 700);
                     window.clearInterval(timeEvent);     
                 }
            }
            timeEvent = window.setInterval("func()", 50);
        </script>
    </div>


Best Regards,
Amy
E-iceblue support team
User avatar

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

Thu Nov 19, 2015 7:37 am

Hi,

Does the feature meet your requirement?
Thanks for your feedback.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Fri Nov 20, 2015 1:02 pm

I tested the function "AdaptiveSize" and I tried to use percentage in this function but it didn't works.
Does possible adapt the size in percentage and not in pixeles?. I need to use percentage because my iframe is located
in Dynamics Crm and the iframe uses a class of Dynamics.

The file pdf shows like an image in the Spire.PDFViewer.

<img id="PdfViewer1_loading_1" style="display: none; position: absolute;" alt="image" src="/WebResource.axd?d=-q_Q2i3L5Y-i1LwJEta8TjAB695WPxqjAuH96bh5n21O-f9qI4DJqeZ3hZpApHra6uP3hcmwn3stfJ-2pvPN6tjMiNaZa8DVyh3BwKdSvcrh7w00kPLBT4gUQVNr3YuT9JOdo4dPRwF6I29U_r0NhisF_7MMghgd36JAm2yIJ9Q1&amp;t=635834126367803311">

Is it possible to display directly the file pdf and not the image of this document?

Blanquita_84
 
Posts: 44
Joined: Tue Oct 13, 2015 8:58 am

Mon Nov 23, 2015 3:43 am

Hi,

Thanks for your feedback.
The method with the size in percentage also needs to know the iframe's szie, which likes pdfviewer1.AdaptiveSize(iframe.width, iframe.height, 50%). So it doesn't need to be done, you can use the existed method likes pdfviewer1.AdaptiveSize(iframe.width*50%, iframe.height*50%).

Sorry that our Spire.PDFViewer only support to display the image of this document.

Best Regards,
Amy
E-iceblue support team
User avatar

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

Tue Nov 24, 2015 10:55 am

Hi!

In some cases the users can be select the default page to display in the PDFViewer.
Can I access the value of the input "PdfViewer1_PdfViewerCurrentPage" in the event onload for change the first page for another?

<input id="PdfViewer1_PdfViewerCurrentPage" style="width: 30px; vertical-align: middle;" onkeydown="return pdfviewer1.GoToPage(event,this.value)" onchange=" return pdfviewer1.CurrentPageInput(this.value)" value="1">

Thanks!

Blanquita_84
 
Posts: 44
Joined: Tue Oct 13, 2015 8:58 am

Tue Nov 24, 2015 3:12 pm

Hi!

I have another question.

The documents show better with the option of toolbar "PdfViewer1_btnAdaptiveWidth".

Is possible set like the default zoom, the same that is generate in the button "PdfViewer1_btnAdaptiveWidth"?.


<img id="PdfViewer1_btnAdaptiveWidth" style="vertical-align: middle; cursor: pointer;" onclick="pdfviewer1.AdaptiveWidth()" src="/WebResource.axd?d=jUJjaongMXqgrhw0dbj2JmD2TXFBxtY_MZZULs3toXebubUoi2AriPiyLLbpPwOz44ie5DInXnW27A1yS1YjiME6l5Px3cDUyukWPIJKCtKzoVG4L_4daZO2G8WozpdrfM35y7lsEW4hn7in8VCPsQdy74DnYEOl25TTkdzhi5A1&amp;t=635826377362517500">

Thanks!!

Blanquita_84
 
Posts: 44
Joined: Tue Oct 13, 2015 8:58 am

Wed Nov 25, 2015 2:28 am

Hi,

Thanks for your further inquiry.
PdfViewer control has the function of going to specified page and adaptive page width function, please check the attached.
If you want to use pdfDocumentViewer control and design these two functions by yourself, please try the following code.
Code: Select all
<input type="button" id="btnFirst" value="first" onclick="pdfdocumentviewer1.FirstPage()" />
<input type="button" id="btnPrevious" value="Previous"
onclick="pdfdocumentviewer1.PreviousPage()" />
<input type="text" id="PdfDocumentViewer1_PdfViewerCurrentPage" value="1" style="width: 50px;" />
<span id="PdfDocumentViewer1_PdfViwerCountPage"></span>
<input type="button" id="btnNext" value="Next" onclick="pdfdocumentviewer1.NextPage()" />
<input type="button" id="btnLast" value="Last" onclick="pdfdocumentviewer1.LastPage()" />

<input type="button" id="btnAdaptiveWidth" value="AdaptiveWidth" onclick="PdfDocumentViewer1.AdaptiveWidth()" />
<cc1:PdfDocumentViewer ID="PdfDocumentViewer1" runat="server" width="800px" Height="800px">
</cc1:PdfDocumentViewer>


Best Regards,
Amy
E-iceblue support team
User avatar

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

Return to Spire.PDFViewer