Getting the target URL for an external link from PdfAnnotation.PdfImportedLink

I am extracting external links from a PDF document using PdfReader.getLinks, which returns an array of PdfAnnotation.PdfImportedLink objects, and ignoring those that are internal.

Using RUPS, I see that the URI of these objects is stored in the '/A' key of the annotation, which itself is a dictionary which contains the '/URI' key whose value is the external link.

However, it doesn't appear that this is accessible via the interface of PdfAnnotation or PdfAnnotation.PdfImportedLink.

Embedded tabs causes background to be placed differently than text for following chunks

Hello,

The following C# code places two paragraphs into a document:

<>

Paragraph text = new Paragraph(12);
Chunk chunk = new Chunk("Request\t\t\t Date [");
text.Add(chunk);

Chunk date = new Chunk("February 29,2024");
date.SetBackground(BaseColor.LIGHT_GRAY);
text.Add(date);

Chunk close = new Chunk("]");
text.Add(close);

document.Add(text);

text = new Paragraph(12);
chunk = new Chunk("Request Date [");
text.Add(chunk);
text.Add(date);
text.Add(close);
document.Add(text);

<>

NotAllowedError: on posting to html from PDF

I downloaded the part3.chapter09.JSForm example and it works perfectly. I used the same code to add the "POST TO HTML" button on my own pdf file. however, when I clicked on the button, I got error as follows on a javascript debugger popup window:

"Built-in Functions Version 9.0

Acrobat Annotations / Collaboration Built-in Wizard Functions Version 9.0

Acrobat SOAP 9.0

NotAllowedError: Security settings prevent access to this property or method.

Doc.disclosed:1:Field post:Mouse Up"

Is this a security issue? Please help. Thank you in advance.

Help needed with crop box (Hero2.java)

I have a severe problem understanding com.itextpdf.text.Rectangle and the crop box.
I have the same requirements as described in Hero2.java with some minor differences which I can't seem to solve.

+ I have Swing app which draws some chart
+ the user can manipulate that chart by moving things around, changing lines etc etc
+ all that is done in a JPanel of an arbitrary size (as large as the user wants it to be)

Template not rendering as expected

Basically copied the code from MovieCountries1.java to create a footer with 'page X of Y' content. Using 5.1 version of iText. Seeing an odd rendering behavior.

Tab chunks DirectorOverview3

I can not get the DirectorOverview3.java to build the pdf like the one described in the book. I downloaded the code for your svn location and ran the java class in eclipse. I am running from a windows machine. The resulting pdf has all the text but the output did not match the books. The text was not moved over to the correct location. Bellow is a sample

Kubrick, Stanleymovies: 12
Killer's Kiss67 minutes1955
The Killing85 minutes1956

Barcode

Hi Bruno,

I created an image of a barcode using:

Barcode39 code39 = new Barcode39();
code39.setCode(order_ID);
img = code39.createImageWithBarcode(writer.getDirectContent(), null, null);

Everything was fine until there is a group number associated with the order_ID. I did

code39.setCode(order_ID + "-" + groupNumber);

The image looks OK. But the scanner would not read it. What do you think is the problem? The symbol "-"?

Thanks in advance.
Jiujing

Footers - Multiple lines?

Is it possible to add multi-line footers to a document, using the techniques described in Chapter 5? I have the following code:

Date today = new Date();
Format formatter = new SimpleDateFormat("dd MMM yyyy");

Phrase footer = new Phrase(new Chunk("PRICES ARE EX MELBOURNE / PERTH / BRISBANE WAREHOUSE\n", BOLD10));

footer.setLeading(12);
footer.add(new Chunk("There is no obligation to comply with these prices. Date Printed: " + formatter.format(today), NORM10));

Table of content

Hi Bruno,

I know there are bookmarks helping people to find what they need. But what if I want
to have a 'Table of Content' at the begining of the documentation? Do I have to
write the content into the memory and count the pages somehow while writing? Do you
have an example?

Thanks in advance.

Jiujing Gu

List item indentation

Hi,

I was playing with MovieLists2.java. I tried to add some indentation to the country list
by adding

item.setIndentationLeft(20);

after line 64. To my surprise, the indentation was addded to the movielist. How do I
add indentation to the country list?

Thanks in advance.
Jiujing Gu

Syndicate content