Subject: Re: Making Links in PDF




Hey Jeremias,

thanks for looking on it.
My intension is to add some internal links from one page to another like it
is done with pdfmarks in ps-files. I'm drawing some "shapes" on a JPanel and
these are painted onto the PDFDocumentGraphics2D. Now there should be a
frame around the shape, where a user can click on it to get redirected onto
another page in the pdf where there is a detailed view of that shape.

Somehow
pdf2D.addLink(rect, Tx, "/FitR", 1);

won't work either.

Thanks Tim



Jeremias Maerki-2 wrote:
>
> Finally got to look into that. Two things:
>
> 1. There was a bug in PDFFactory that caused the bug you mention. I've
> just fixed that: http://svn.apache.org/viewvc?rev=744690&view=rev
> But that only really fixes part of a problem with SVG #svgView(viewBox())
> functionality (as mentioned in the commit message). For reference, the
> SVG test case to reproduce the problem can be found here:
> http://svn.apache.org/repos/asf/xmlgraphics/batik/trunk/samples/tests/spec/linking/linkingViewBox.svg
>
> 2. But you seem to want to use PDFDocumentGraphics2D outside an SVG
> context. Looking at the code I don't think that was foreseen. The code
> covers only the functionality required by above-mentioned #svgView stuff,
> either external links or the viewBox() method (FitR in PDF). Things like
> /XYZ cannot be done using PDFGraphics2D.addLink at the moment. For that,
> the code would have to be refactored.
>
> If you pass "0 0 10 10" (or other 4 integers representing arguments to
> the /FitR function) as "dest" parameter into addLink(), it should work.
> But specifying the function itself will lead to errors in Acrobat Reader.
>
> Patches to improve that (and above SVG problem) are welcome.
>
> On 13.02.2009 12:05:17 useratnab wrote:
>>
>> Hello,
>>
>> I get an "Exception in thread "AWT-EventQueue-0"
>> java.lang.IllegalArgumentException: Cannot reference this object. It
>> doesn't
>> have an object number"
>>
>> Is there somehting wrong with using "addLink"?
>>
>> <pre>
>> PDFDocumentGraphics2D pdf2D;
>> AffineTransform Tx = new AffineTransform( 1, 0, 0, 1, 0, 0);
>>
>> Rectangle2D rect = new Rectangle2D.Double ();
>> rect.setRect (20., 20., 100., 50.);
>>
>> // 0 --> other files
>> // 1 --> another pos in same file
>> // 2 --> URL
>> pdf2D.addLink(rect, Tx, "[/XYZ 0 0 null]", 1);
>> </pre>
>>
>> Thank you
>> Tim
>> --
>> View this message in context:
>> http://www.nabble.com/Making-Links-in-PDF-tp21994320p21994320.html
>> Sent from the FOP - Users mailing list archive at Nabble.com.
>>
>
>
>
> Jeremias Maerki
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx
> For additional commands, e-mail: fop-users-help@xxxxxxxxxxxxxxxxxxxxxx
>
>
>

--
View this message in context:
http://www.nabble.com/Making-Links-in-PDF-tp21994320p22076342.html
Sent from the FOP - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: fop-users-unsubscribe@xxxxxxxxxxxxxxxxxxxxxx
For additional commands, e-mail: fop-users-help@xxxxxxxxxxxxxxxxxxxxxx



Privacy