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

Wed Sep 13, 2017 3:06 pm

For PDF Viewer, Doc Viewer, and Office Viewer ...
They work great, very happy, but I have a few requests.

I want to be able to set the 'fit' to default to a specific setting. Is there anyway to do that?
I want to be able to hide the 'Open File' button.

Is there anyway to expose the actions the supplied menu has so I can call them programatically in code?

MJCredland
 
Posts: 5
Joined: Wed Jun 10, 2015 11:03 pm

Thu Sep 14, 2017 6:32 am

Dear MJCredland,

Thanks for your inquiry.
There are some guides about how to design the viewers programmatically.
https://www.e-iceblue.com/Tutorials/Spi ... Guide.html
https://www.e-iceblue.com/Tutorials/Spi ... Guide.html
And you also could get some demos after installing the the viewers package. If there is still issue, please let us know and describe your requirements in detail.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Thu Sep 14, 2017 12:15 pm

Basically, the methods to FitPage/FitWidth do not seem to be exposed for the Viewers. Also, you are limited on what functionality on the toolbar you can hide. I don't want the 'Open File' option.

None of the samples seem to show me how to do those things.
Please help.

MJCredland
 
Posts: 5
Joined: Wed Jun 10, 2015 11:03 pm

Fri Sep 15, 2017 2:10 am

Dear MJCredland,

Sorry that the demos didn't help you.
I guess there is misunderstanding. There are two primary controls when you add Spire Viewer dll. Let me take Doc viewer as example, one is DocViewer which already has options and you could not change options on it, the another is DocDocumentViewer which doesn't have any option and you could design it programmatically.
For the FitPage/FitWidth, please refer to below code.
Code: Select all
//Doc Viewer, DocDocumentViewer control
this.docDocumentViewer1.ZoomMode = ZoomMode.FitWidth;
//PDF viewer, PdfDocumentViewer control
this.pdfDocumentViewer2.SetZoom(Spire.PdfViewer.Forms.ZoomMode.FitWidth);
//Office viewer, DocumentViewer control
this.documentViewer1.ZoomMode = Spire.OfficeViewer.Forms.ZoomMode.FitPage;

For the 'Open File' option, please don't use it when designing.
Hope these information could help you. If there is any question, please let me know.

Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Fri Sep 15, 2017 11:30 am

I am on version 2.4.16.14040 and none of those properties/methods are available.
Is there a newer version or am I missing something?

MJCredland
 
Posts: 5
Joined: Wed Jun 10, 2015 11:03 pm

Mon Sep 18, 2017 2:10 am

Dear MJCredland,

Sorry for late reply as weekend.
I have checked the Spire.DocViewer.dll V2.4.16 in Spire.Office V2.16.12, and the method is available in DocDocumentViewer, did you use right control ?
Code: Select all
//Doc Viewer, DocDocumentViewer control
this.docDocumentViewer1.ZoomMode = ZoomMode.FitWidth;


Sincerely,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Wed Sep 20, 2017 8:02 am

Dear MJCredland,

How is the issue going?
Your feedback would be much appreciated.

Thanks,
Betsy
E-iceblue support team
User avatar

Betsy.jiang
 
Posts: 3099
Joined: Tue Sep 06, 2016 8:30 am

Return to Spire.PDFViewer