Nope, still does not open the document. All I get is the "My Computer" window.
// add a link to the FRD
paragraph = new Paragraph("FRD:");
paragraph.add(Chunk.NEWLINE);
// This is the new code to try, per Paulo Soares
Chunk ck = new Chunk(cur_frd.filename(), FontFactory.getFont(FontFactory.HELVETICA, 10, Font.UNDERLINE, new java.awt.Color(0, 0, 255)));
ck.setAnchor("file:///".concat(cur_frd.filename().replace('\\','/')));
// This is the original code for the anchor
/*Anchor frdDoc = new Anchor(cur_frd.filename(), FontFactory.getFont(FontFactory.HELVETICA, 10, Font.UNDERLINE, new java.awt.Color(0, 0, 255)));
frdDoc.setReference("file:///".concat(cur_frd.filename()));
frdDoc.setName("frdDocLink");*/
paragraph.add(ck);
cell = new Cell(paragraph);
cell.setColspan(2);
table.addCell(cell);
Dang
-----Original Message-----
From: Paulo Soares [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, September 04, 2002 11:15 AM
To: 'Dang Nguyen'; '[EMAIL PROTECTED]'
Subject: RE: [iText-questions] Anchor.setReference not loading local
file reference
This code works for me:
Chunk ck = new Chunk(text, font);
ck.setAnchor("file:///c:/consis_dump.txt");
document.add(new Paragraph(ck));
with both Acrobat and Reader 5.05.
Best Regards,
Paulo Soares
> -----Original Message-----
> From: Dang Nguyen [SMTP:[EMAIL PROTECTED]]
> Sent: Wednesday, September 04, 2002 19:03
> To: '[EMAIL PROTECTED]'
> Subject: [iText-questions] Anchor.setReference not loading local file
> reference
>
> In my iText-generated PDF document, I am attempting to create an Anchor
> which links to a file on the local network, which is accessible to all of
> our intranet users. The URL is in the form "
> <file:///S:/path/to/the/file.doc>" but it does not work when users click
> on the link within the PDF document. However, if this link is copied to
> the address bar of Internet Explorer, then the document is opened as
> expected. What is my problem?
>
> Excerpt from my code:
>
> Anchor frdDoc = new Anchor(cur_frd.filename(),
> FontFactory.getFont(FontFactory.HELVETICA, 10, Font.UNDERLINE, new
> java.awt.Color(0, 0, 255)));
>
> frdDoc.setReference(" <file:///>".concat(cur_frd.filename()));
>
> frdDoc.setName("frdDocLink");
> paragraph.add(frdDoc);
>
> In the above snippet, cur_frd.filename() produces the drive letter, path
> and filename appropriately.
>
> Dang Nguyen
> [EMAIL PROTECTED]
> Marconi Wireless
> Direct Phone: 425-519-2043
> Fax: 425-519-7280
>