Wx::ActiveX::Acrobat - Interface for Acrobat Reader ActiveX Control.
Version 0.10
use Wx::ActiveX::Acrobat qw( :everything ); .......... my $acrobat = Wx::ActiveX::Acrobat->new( $parent ); OR my $acrobat = Wx::ActiveX::Acrobat->newVersion( 1, $parent ); EVT_ACTIVEX_ACROBAT_ONERROR( $handler, $acrobat, \&on_event_onerror ); ........ # freeze while we setup visuals $acrobat->Freeze; $acrobat->LoadFile("./test.pdf"); $acrobat->SetShowToolBar(0); $acrobat->SetPageMode(bookmarks); $acrobat->Thaw;
ActiveX control for Acrobat Reader. The control inherits from Wx::ActiveX, and all methods/events from there are available here too. Available methods allow setting of toolbars, print ranges, views and print dialogs from code.
my $activex = Wx::ActiveX::Acrobat->new( $parent, $windowid, $position, $size, $style, $name);
Returns a new instance of Wx::ActiveX::Acrobat. Only $parent is mandatory. $parent must be derived from Wx::Window (e.g. Wx::Frame, Wx::Panel etc). This constructor creates an instance using the latest version available of AcroPDF.PDF.
my $activex = Wx::ActiveX::Acrobat->newVersion( $version $parent, $windowid, $position, $size, $style, $name);
Returns a new instance of Wx::ActiveX::Acrobat. $version and $parent are mandatory. $parent must be derived from Wx::Window (e.g. Wx::Frame, Wx::Panel etc). This constructor creates an instance using the specific type library specified in $version of AcroPDF.PDF.
e.g. $version = 4;
will produce an instance based on the type library for
AcroPDF.PDF.4
$activex->GoBackwardStack();
Goes to the previous view on the view stack, if the previous view exists. This may be in a different document.
$activex->GoForwardStack();
Goes to the next view on the view stack, if the next view exists. This may be in a different document.
$activex->GotoFirstPage();
Goes to the first page in the document, maintaining the current location within the page and zoom level.
$activex->GotoLastPage();
Goes to the last page in the document, maintaining the current location within the page and zoom level.
$activex->GotoNextPage();
Goes to the next page in the document, if it exists. Maintains the current location within the page and zoom level.
$activex->GotoPreviousPage();
Goes to the previous page in the document, if it exists. Maintains the current location within the page and zoom level.
$activex->LoadFile( $url );
Opens and displays the specified document within the ActiveX control.
$activex->Print();
Prints the document showing the standard Acrobat dialog box.
$activex->PrintAll();
Prints the entire document without displaying a user dialog box.
$activex->PrintAllFit();
Prints the entire document without displaying a user dialog box, and the pages are shrunk, if necessary, to fit into the imageable area of a page in the printer.
$activex->PrintPages( $from, $to );
Prints the specified pages without displaying a user dialog box.
$activex->PrintPagesFit( $from, $to );
$activex->PrintWithDialog();
Prints the document according to the options selected in a user dialog box. This is attached to a separate Acrobat window that will persist. If you want a dialog you probably want the Print method rather than this.
$activex->SetCurrentHighlight( $left, $top, $width, $height );
Highlights the text selection within the specified bounding rectangle on the current page.
$activex->SetCurrentPage( $pageno );
Goes to the specified page in the document.
$activex->SetLayoutMode( $mode );
Sets the layout mode for a page view according to the specified string.
mode:
'DontCare' — use the current user preference 'SinglePage' — use single page mode (pre Acrobat 3.0 style) 'OneColumn' — use one-column continuous mode 'TwoColumnLeft' — use two-column continuous mode with the first page on the left 'TwoColumnRight'— use two-column continuous mode with the first page on the right
$activex->SetNamedDest( $destination );
Changes the page view to the named destination in the specified string.
$activex->SetPageMode( $mode );
Sets the page mode according to the specified string.
'none' — displays the document, but does not display bookmarks or thumbnails (default) 'bookmarks' — displays the document and bookmarks 'thumbs' — displays the document and thumbnails
$activex->SetShowScrollbars( $bool );
Determines whether scrollbars will appear in the document view.
$activex->SetShowToolbar( $bool );
Determines whether a toolbar will appear in the viewer.
$activex->SetView( $view );
Sets the view of a page according to the specified string.
view:
'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 width of the bounding box within the window. 'FitB' — Fits the height of the bounding box within the window
$activex->SetViewRect( $left, $top, $width, $height );
Sets the view rectangle according to the specified coordinates.
$activex->SetViewScroll( $view, $offset );
'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 width of the bounding box within the window. 'FitBV' — Fits the height of the bounding box within the window
offset:
The horizontal or vertical coordinate positioned either at the left or top edge.
$activex->SetZoom( $percent );
Sets the magnification according to the specified value.
percent
The desired zoom factor, expressed as a percentage. For example, 1.0 represents a magnification of 100%.
$activex->SetZoomScroll( );
Sets the magnification according to the specified value, and scrolls the page view both horizontally and vertically according to the specified amounts.
left
The horizontal coordinate positioned at the left edge.
top
The vertical coordinate positioned at the top edge.
$activex->PropSet('src', 'c:\pathto\myfile.pdf'); $loadedfile = $activex->PropVal('src');
Gets or sets the URL for the document
EVT_ACTIVEX_ACROBAT_ONERROR($handler, $axcontrol, \&event_sub); EVT_ACTIVEX_ACROBAT_ONMESSAGE($handler, $axcontrol, \&event_sub);
my $info = $activex->ActivexInfos();
AddRef() GetIDsOfNames(riid , rgszNames , cNames , lcid , rgdispid) GetTypeInfo(itinfo , lcid , pptinfo) GetTypeInfoCount(pctinfo) GetVersions() goBackwardStack() goForwardStack() gotoFirstPage() gotoLastPage() gotoNextPage() gotoPreviousPage() Invoke(dispidMember , riid , lcid , wFlags , pdispparams , pvarResult , pexcepinfo , puArgErr) LoadFile(fileName) postMessage(strArray) Print() printAll() printAllFit(shrinkToFit) printPages(from , to) printPagesFit(from , to , shrinkToFit) printWithDialog() QueryInterface(riid , ppvObj) Release() setCurrentHighlight(a , b , c , d) setCurrentHightlight(a , b , c , d) setCurrentPage(n) setLayoutMode(layoutMode) setNamedDest(namedDest) setPageMode(pageMode) setShowScrollbars(On) setShowToolbar(On) setView(viewMode) setViewRect(left , top , width , height) setViewScroll(viewMode , offset) setZoom(percent) setZoomScroll(percent , left , top)
messageHandler (wxVariant) src (wxString)
OnError OnMessage
Wx::ActiveX, Wx
Wx::ActiveX has benefited from many contributors:
Graciliano Monteiro Passos - original author
Contributions from:
Simon Flack Mattia Barbon Eric Wilhelm Andy Levine Mark Dootson
Thanks to Justin Bradford and Lindsay Mathieson who wrote the C classes for wxActiveX and wxIEHtmlWin.
Copyright (C) 2002-2008 Authors & Contributors, all rights reserved.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Mark Dootson <mdootson@cpan.org>
1 POD Error
The following errors were encountered while parsing the POD:
Non-ASCII character seen before =encoding in '—'. Assuming UTF-8
To install Wx::ActiveX, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Wx::ActiveX
CPAN shell
perl -MCPAN -e shell install Wx::ActiveX
For more information on module installation, please visit the detailed CPAN module installation guide.