next up previous contents
Next: Calling Active scripting languages Up: Tutorials Previous: Playing avi, rm, mov,   Contents

Opening pdf files

You can use the "Shell.open" method or the "exec" command to open pdf files with an external application, which is generally the Adobe Acrobat PDF Reader. However, you still can display a pdf file in the main window or in a form, by embedding a Adobe Acrobat PDF reader ActiveX control.
var ax = createControl("AcroPDF.PDF", 0, 0, 200, 200);
ax.activex.loadFile("c:\\my.pdf");

The methods and properties of the Adobe Acrobat PDF ActiveX control are listed as follows:

dispinterface IAcroAXDocShim {
    properties:
    methods:
        [id(0x00000001), propget, helpstring("property src")]
        BSTR src();
        [id(0x00000001), propput, helpstring("property src")]
        void src([in] BSTR rhs);
        [id(0x00000002), helpstring("method LoadFile")]
        VARIANT_BOOL LoadFile([in] BSTR fileName);
        [id(0x00000003), helpstring("method setShowToolbar")]
        void setShowToolbar([in] VARIANT_BOOL On);
        [id(0x00000004), helpstring("method gotoFirstPage")]
        void gotoFirstPage();
        [id(0x00000005), helpstring("method gotoLastPage")]
        void gotoLastPage();
        [id(0x00000006), helpstring("method gotoNextPage")]
        void gotoNextPage();
        [id(0x00000007), helpstring("method gotoPreviousPage")]
        void gotoPreviousPage();
        [id(0x00000008), helpstring("method setCurrentPage")]
        void setCurrentPage([in] long n);
        [id(0x00000009), helpstring("method goForwardStack")]
        void goForwardStack();
        [id(0x0000000a), helpstring("method goBackwardStack")]
        void goBackwardStack();
        [id(0x0000000b), helpstring("method setPageMode")]
        void setPageMode([in] BSTR pageMode);
        [id(0x0000000c), helpstring("method setLayoutMode")]
        void setLayoutMode([in] BSTR layoutMode);
        [id(0x0000000d), helpstring("method setNamedDest")]
        void setNamedDest([in] BSTR namedDest);
        [id(0x0000000e), helpstring("method Print")]
        void Print();
        [id(0x0000000f), helpstring("method printWithDialog")]
        void printWithDialog();
        [id(0x00000010), helpstring("method setZoom")]
        void setZoom([in] single percent);
        [id(0x00000011), helpstring("method setZoomScroll")]
        void setZoomScroll(
                        [in] single percent,
                        [in] single left,
                        [in] single top);
        [id(0x00000012), helpstring("method setView")]
        void setView([in] BSTR viewMode);
        [id(0x00000013), helpstring("method setViewScroll")]
        void setViewScroll(
                        [in] BSTR viewMode,
                        [in] single offset);
        [id(0x00000014), helpstring("method setViewRect")]
        void setViewRect(
                        [in] single left,
                        [in] single top,
                        [in] single width,
                        [in] single height);
        [id(0x00000015), helpstring("method printPages")]
        void printPages(
                        [in] long from,
                        [in] long to);
        [id(0x00000016), helpstring("method printPagesFit")]
        void printPagesFit(
                        [in] long from,
                        [in] long to,
                        [in] VARIANT_BOOL shrinkToFit);
        [id(0x00000017), helpstring("method printAll")]
        void printAll();
        [id(0x00000018), helpstring("method printAllFit")]
        void printAllFit([in] VARIANT_BOOL shrinkToFit);
        [id(0x00000019), helpstring("method setShowScrollbars")]
        void setShowScrollbars([in] VARIANT_BOOL On);
        [id(0x0000001a), helpstring("method GetVersions")]
        VARIANT GetVersions();
        [id(0x0000001b), helpstring("method setCurrentHightlight")]
        void setCurrentHightlight(
                        [in] long a,
                        [in] long b,
                        [in] long c,
                        [in] long d);
        [id(0x0000001c), helpstring("method setCurrentHighlight")]
        void setCurrentHighlight(
                        [in] long a,
                        [in] long b,
                        [in] long c,
                        [in] long d);
};
Please read the "Reusing the web browser control" tutorial to learn more details about using ActiveX controls.



Copyright ©2000-2007 Shanghai TopCMM Software Technologies. All Rights Reserved.