PDF Viewer Component - ApplyZoom
Posted by office viewer on October 20th, 2007Function: boolean ApplyZoom (float percent);
Description: Set the zoom factor for document page view.
Params: Specify the zoom factor in %.
Function: boolean ApplyZoom (float percent);
Description: Set the zoom factor for document page view.
Params: Specify the zoom factor in %.
Function: boolean ApplyZoomScroll (float percent, float left, float top);
Description: Sets the zoom and scroll factors, using float or integer values. For example, a scale value of 100 indicates a zoom value of 100%.
Scroll values left and top are in a coordinate system where 0,0 represents the top left corner of the visible page, regardless of document rotation.
Function: boolean ApplyView (BSTR viewMode);
Description: Sets the view of a page according to the specified string.
Params: Possible values: “Fit”: fits the entire page within the window both vertically and horizontally. “FitH”: fits the entire width of the page within the window. “FitV”: fits the entire height of the page within the window. “FitB”: fits the bounding box within the window both vertically and horizontally. “FitBH”: fits the entire width of the bounding box within the window. “FitBV”: fits the entire height of the bounding box within the window.
Function: boolean ApplyViewRect(float left, float top, float width, float height)
Description: Sets the view rectangle according to the specified coordinates.
Param:
left - The upper left horizontal coordinate.
top - The vertical coordinate in the upper left corner.
width - The horizontal width of the rectangle.
height - The vertical height of the rectangle.
boolean PrintPages(long from, long to);
Description: Prints the specified pages without displaying a user dialog box. The current printer, page settings, and job settings are used.This method returns immediately, even if the printing has not completed. NOTE: If security settings do not allow printing, this method will be ignored.
Param:
from - The page number of the first page to be printed. The first page in a document is page 0.
to - The page number of the last page to be printed.
Function: boolean PrintPagesFit(long from, long to, boolean shrinkToFit);
Description: Prints the specified pages without displaying a user dialog box. The current printer, page settings, and job settings are used. This method returns immediately, even if the printing has not completed. NOTE:If security settings do not allow printing, this method will be ignored.
Param:
from - The page number of the first page to be printed. The first page in a document is page 0.
to - The page number of the last page to be printed.
shrinkToFit - Specifies whether the pages will be shrunk, if necessary, to fit into the imageable area of a page in the printer.
Function: boolean PrintAll ();
Description: Prints the entire document without displaying a user dialog box. The current printer, page settings, and job settings are used. This method returns immediately, even if the printing has not completed. NOTE: If security settings do not allow printing, this method will be ignored.
1. File Path
Property: BSTR Path
Description: The property will save the open file path.
You can use the property to decide whether the component opened a PDF file.
If PDFViewer1.Path != “” Then
PDFViewer1. ApplyZoom 0.75
End If
2. Show or hide the toolbars
Property: boolean Toolbars
Description: Show/Hide whether toolbars should be displayed.
You can open a PDF document without toolbars as follow:
If OA1.GetToolbars = True Then
OA1.oolbars False
Else
OA1.Toolbars True
End If
3. Show or hide the navigation panes
Property: boolean NavPanes
Description: Show/Hide whether navigation panels should be displayed.
4. Show or hide the messages
Property: boolean Messages
Description: Show/Hide whether messages should be displayed.
5. Show or hide the scrollbar
Property: boolean Scrollbar
Description: Show/Hide whether scrollbar should be displayed.
6. Show or hide the statusbar
Property: boolean Statusbar
Description: Show/Hide whether statusbar should be displayed.
7. Set the Parameters for the Open Document.
Property: BSTR NamedDest;
BSTR Page;
BSTR Comment;
BSTR Zoom;
BSTR View;
BSTR ViewRect;
BSTR PageMode;
BSTR Search;
BSTR Highlight;
Description: These properties have the same function with the above methods. If you special the Zoom as 75, the component will open any PDF document with the default 75% view zoom. If you special the Search as “Flowchart”, the component will highlight the Flowchart word when it opens a PDF document.
8. Modify the Border Style
Property: short BorderStyle;
Description: Set the caption of the titlebar.
The property allows the developer to modify the border style. It can be the follow value:
typedef enum BorderStyle
{
BorderNone = 0,
BorderFlat,
Border3D,
Border3DThin
} BorderStyle;
<object classid=”clsid:053AFEBA-D968-435F-B557-19FF76372B1B” id=”EDrawOfficeViewer1″ width=”657″ height=”452″>
<param name=”BorderStyle” value=”2″>
</object>
9. Set the Color Scheme
Properties:
OLE_COLOR BorderColor;
OLE_COLOR BackColor;
OLE_COLOR ForeColor;
OLE_COLOR TitlebarColor;
OLE_COLOR TitlebarTextColor;
Description: Set the color scheme for the component.
<object classid=”clsid:053AFEBA-D968-435F-B557-19FF76372B1B” id=”EDrawOfficeViewer1″ width=”657″ height=”452″>
<param name=”BorderColor” value=”-2147483632″>
<param name=”BackColor” value=”-2147483643″>
<param name=”ForeColor” value=”-2147483640″>
<param name=”TitlebarColor” value=”-2147483635″>
<param name=”TitlebarTextColor” value=”-2147483634″>
</object>
10. Modify the TitlebarText
Property: BSTR TitlebarText;
Description: Set the caption of the titlebar.
The property allows the developer to modify the caption in the titlebar.
<object classid=”clsid: 44A8091F-8F01-43B7-8CF7-4BBA71E61E04″ id=”PDFViewer1″ width=”657″ height=”452″>
<param name=” TitlebarText ” value=”PDF Viewer Component”>
</object>
11. Set the Color Scheme
Property: BSTR LicenseName
Description: Gets/Sets the license name.
12. License Key
Property: BSTR LicenseKey
Description: Gets/Sets the license key.
I am using ASP.NET, C# version 2.0
My concern is that, when the user will close the document on the web
browser, my code will get the line-count through your control and save
in the DB.
Please help me to get line count of the opened document in the component
in the IE.
If possible please send me the sample code to get the line-count using
Javascript.
I have an templated created by using the “Word Template” project in VSTO 2005.
When i open either a document based on my VSTO 2005 template or the template directly using the Edraw Office OADemo.exe the StartUp Event (ThisDocument_StartUp) is never called.
Is this a bug or am i missing something?
Lars.
Recent Comments