The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Wx::ActiveX::Acrobat - Interface for Acrobat Reader ActiveX Control.

VERSION

Version 0.10

SYNOPSIS

    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;

DESCRIPTION

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.

METHODS

new

    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.

newVersion

    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

GoBackwardStack

    $activex->GoBackwardStack();

Goes to the previous view on the view stack, if the previous view exists. This may be in a different document.

GoForwardStack

    $activex->GoForwardStack();

Goes to the next view on the view stack, if the next view exists. This may be in a different document.

GotoFirstPage

    $activex->GotoFirstPage();

Goes to the first page in the document, maintaining the current location within the page and zoom level.

GotoLastPage

    $activex->GotoLastPage();

Goes to the last page in the document, maintaining the current location within the page and zoom level.

GotoNextPage

    $activex->GotoNextPage();

Goes to the next page in the document, if it exists. Maintains the current location within the page and zoom level.

GotoPreviousPage

    $activex->GotoPreviousPage();

Goes to the previous page in the document, if it exists. Maintains the current location within the page and zoom level.

LoadFile

    $activex->LoadFile( $url );

Opens and displays the specified document within the ActiveX control.

Print

    $activex->Print();

Prints the document showing the standard Acrobat dialog box.

PrintAll

    $activex->PrintAll();

Prints the entire document without displaying a user dialog box.

PrintAllFit

    $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.

PrintPages

    $activex->PrintPages( $from, $to );

Prints the specified pages without displaying a user dialog box.

PrintPagesFit

    $activex->PrintPagesFit( $from, $to );

Prints the specified pages without displaying a user dialog box.

PrintWithDialog

    $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.

SetCurrentHighlight

    $activex->SetCurrentHighlight( $left, $top, $width, $height );

Highlights the text selection within the specified bounding rectangle on the current page.

SetCurrentPage

    $activex->SetCurrentPage( $pageno );

Goes to the specified page in the document.

SetLayoutMode

    $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  

SetNamedDest

    $activex->SetNamedDest( $destination );

Changes the page view to the named destination in the specified string.

SetPageMode

    $activex->SetPageMode( $mode );

Sets the page mode according to the specified string.

mode:

    'none'      — displays the document, but does not display bookmarks or
                  thumbnails (default)
    'bookmarks' — displays the document and bookmarks
    'thumbs'    — displays the document and thumbnails

SetShowScrollbars

    $activex->SetShowScrollbars( $bool );

Determines whether scrollbars will appear in the document view.

SetShowToolbar

    $activex->SetShowToolbar( $bool );

Determines whether a toolbar will appear in the viewer.

SetView

    $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

SetViewRect

    $activex->SetViewRect( $left, $top, $width, $height );

Sets the view rectangle according to the specified coordinates.

SetViewScroll

    $activex->SetViewScroll( $view, $offset );
    

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.
    '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.

SetZoom

    $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%.

SetZoomScroll

    $activex->SetZoomScroll(  );
    

Sets the magnification according to the specified value, and scrolls the page view both horizontally and vertically according to the specified amounts.

percent

    The desired zoom factor, expressed as a percentage. For example,
    1.0 represents a magnification of 100%.

left

    The horizontal coordinate positioned at the left edge.

top

    The vertical coordinate positioned at the top edge.

PROPERTIES

src

    $activex->PropSet('src', 'c:\pathto\myfile.pdf');
    
    $loadedfile = $activex->PropVal('src');

Gets or sets the URL for the document

EVENTS

    EVT_ACTIVEX_ACROBAT_ONERROR($handler, $axcontrol, \&event_sub);
    EVT_ACTIVEX_ACROBAT_ONMESSAGE($handler, $axcontrol, \&event_sub);

ACTIVEX INTERFACE

    my $info = $activex->ActivexInfos();

Methods

    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)

Properties

    messageHandler               (wxVariant)
    src                          (wxString)
    

Events

    OnError
    OnMessage

SEE ALSO

Wx::ActiveX, Wx

AUTHORS & ACKNOWLEDGEMENTS

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 & LICENSE

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.

CURRENT MAINTAINER

Mark Dootson <mdootson@cpan.org>

1 POD Error

The following errors were encountered while parsing the POD:

Around line 287:

Non-ASCII character seen before =encoding in '—'. Assuming UTF-8