Spire.DocViewer for .NET is a powerful Word Viewer component for developers to display, convert and interact with Word Documents easily.

Mon Oct 23, 2017 6:02 am

I am working on a proof of concept. (c# desktop application) I have successfully embedded an instance of DocViewer in a windows form. I need to limit page display to just one page at a time. Pages need need to scrolled programmatically.

I have come across this code which utilises the Document class but I find nothing similiar on the DocViewer class.
Alternatively I don't see how to embed the Document class in a form.
/*
Document doc = new Document();
doc.LoadFromFile(@"E:\Work\Documents\WordDocuments\.NET Framework.docx");
doc.ViewSetup.DocumentViewType = DocumentViewType.WebLayout;
doc.ViewSetup.ZoomPercent = 150;
doc.ViewSetup.ZoomType = ZoomType.None;
*/

While I have read that Docviewer has provision to manipulate the document view type, between these two classes, I just don't see the solution.
Could somebody please help? Thanks.

Secret807
 
Posts: 3
Joined: Fri Apr 15, 2016 7:57 am

Mon Oct 23, 2017 7:33 am

Hi Secret807,

Thanks for your inquiry.
There are two primary controls when you add Spire DocViewer dll. Please note the control Docviewer doesn't support designing programmatically. Please use another control DocDocumentViewer which supports designing programmatically. And here is sample code for your kind reference.
https://www.e-iceblue.com/Tutorials/Spi ... iewer.html
Any question, please feel free to contact us.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Mon Oct 23, 2017 7:53 am

Hi Betsy,
Thanks for the reply. Well the zoom is useful, but I'm still don't discover how to view just one page at a time. like print preview. iow no vertical scroll.
thanks.

Secret807
 
Posts: 3
Joined: Fri Apr 15, 2016 7:57 am

Mon Oct 23, 2017 8:00 am

Hi Secret807,

Please use following code.
Code: Select all
            this.docDocumentViewer1.ZoomMode = ZoomMode.FitPage;


Sincerely,
Betsy
E-iceblue support team
User avatar

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

Tue Oct 24, 2017 10:04 am

Hi Secret807,

Greetings from E-iceblue.
Has your issue been resolved ?
Could you please give us some feedback at your convenience ?

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Wed Oct 25, 2017 4:13 pm

No. Not resolved. I want to see just one page at a time and not be able to scroll to any other pages. I'm thinking something like print preview.
Thanks.

Secret807
 
Posts: 3
Joined: Fri Apr 15, 2016 7:57 am

Thu Oct 26, 2017 4:00 am

Hi Secret807,

Thanks for your feedback.
After further investigation, we found the function "not be able to scroll to any other pages" is not supported. The only thing available is hiding the scrollbar, even that people can still scroll the page by mouse.
Code: Select all
//note this solution is only useful in WPF
this.docDocumentViewer1.VerticalScrollBarVisibility = ScrollBarVisibility.Hidden;

If there is any other issue, please let us know.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Wed Nov 22, 2017 2:23 am

Hi Secret807,

Thanks for your waiting.
Now the feature hiding the scrollbar in Winform has been implemented in Spire.DocViewer Pack(Hotfix) Version:2.4.37.
Code: Select all
            this.docDocumentViewer1.VerticalScroll.Visible = false;

Looking forward to your feedback.

Sincerely,
Betsy
E-iceblue support team
User avatar

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

Return to Spire.DocViewer