pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andreas Lehmkuehler <andr...@lehmi.de>
Subject Re: PDActionRemoteGoTo
Date Tue, 21 Jun 2011 20:52:16 GMT

Am 21.06.2011 15:48, schrieb Friedrich, Christian (ext):
> Hi Guys,
> Currently I'm using the PDActionRemoteGoTo Class to create links to pages in external
> This works fine with this piece of code:
>>     PDActionRemoteGoTo go = new PDActionRemoteGoTo();
>>     go.setFile(PDFileSpecification.createFS((new COSString("C:/somePDF.pdf"))));
>>     COSArray ca = new COSArray();
>>     ca.add(COSInteger.get(2));
>>     go.setD(ca);
>>     go.setOpenInNewWindow(true);
> The PDF "C:/somePDF.pdf" opens at page 3 when the action is triggered.
> The only problem is that the default view after clicking the link shows the document
with a zoom of 6400%. I would like to view the page in a suitable size (page view). How do
I add this parameter to the PDActionRemoteGoTo object? The only way I could imagine this could
work is adding the information somehow to the COSArray, but how?
I'm not an expert in interactive pdf features but according to the pdf spec Explicit Destinations you have to add some more information to the 
COSArray. There are different options but I guess you looking for the following one:

[page /XYZ left top zoom]

"Display the page designated by page, with the coordinates (left, top) 
positioned at the upper-left corner of the window and the contents of the page 
magnified by the factor zoom. A null value for any of the parameters left, top, 
or zoom specifies that the current value of that parameter shall be retained 
unchanged. A zoom value of 0 has the same meaning as a null value."

Andreas Lehmkühler

View raw message