Extracted images are very dark

Good evening.
I tried to implement listing 15.30 and 15.31 of the book, and images were extracted from a pdf as .jpg files. The problem is that extracted images are very very dark compared to the original pdf. Is there anything I can do to solve this problem?
Thank you
Massimo

Licence of the examples

Unfortunately, I wasn't able to find any information about this: can the examples in the book be modified and reused? If so, under what licence?

How do you flatten a dynamic XFA form?

I have a dyanmic XFA form with a text field and a signature field with reader rights enabled.

I need to make the form read only for non admin users.

when I run the following code:

PdfReader reader = new PdfReader(report.getReportBytes());
reader.removeUsageRights();
ByteArrayOutputStream bao = new ByteArrayOutputStream();

PdfStamper stamper = new PdfStamper(reader, bao);
stamper.setFormFlattening(true);
stamper.close();

report.setReportBytes(bao.toByteArray());

I get the following error when I open the pdf.

How do you flatten a dynamic XFA form?

I have a dynamic pdf with signature fields and text fields on the last page.

If a user downloads the file to view instead of process I want to flatten all of the fields.

Update or remove iText stamp

How do I identify/update an iText stamp? We are updating our PDF “watermarking” process over to iText. The old application places a key value pair in the stamp which I can identify and remove. I need to be able to do the same thing (i.e. remove or update) the stamp which is created in iText. How would I go about doing this?

Keep small table in a page

I have a lot of small tables. I want each small table stay on the same page. So, I did the following:

1. create tOuter = new PdfPTable(1);

2. create tInner and added everything I need for the small table into tInner.

3. add tInner into tOuter (tOuter.addCell(tInner);)

4. added tOuter to my document ( document.add(tOuter);)

I thought since tOuter only has one column and one row, it would altomatically stay on the same page. But, it didn't happen.

What should I do?

Thanks in advance.

How can I add/extract document-level attachments to/from an existing PDF file

I have a PDF file to which I want to add document-level attachments programmatically.
Afterwards, I want to create a tool that allows me to extract these attachments.
Is this possible with iText?

Header vs reorder page for TOC

Hi Bruno,

I need to create a report with a header on each page, except for the 1st page, which
contains the TOC. I was able to reorder pages with the infomation on page 141. But
when I added the header (page 148), the header was added to the TOC page as well. Also, the
ist non-TOC page did not have the header. What should I do about this?

Thanks in advance for any suggestions.

Jiujing Gu

adding content to cell with simulation

I have fixed cell width and height, is there anyway for me to add content in there in simulation mode, then if the content can't fit in, I will decrease the font size and add content again?
On page 104 of the book, it says go() method of internal ColumnText method was invoked. If somehow I can know some content was left out, then I will decrease my font size. Thanks for your help.

Reader Enabled Not Working

I have 2 forms that are reader enabled that I am filling the acroform. The 1st one works without any error, the second gets the pop-up "This document enabled extended features in Adobe Reader ....". I am processing the forms with the same code that sets the PdfStamper to append mode. There is a couple differences that I can find. The one that works, under document properties has the application as Adobe Illustrator CS3 and the producer as Acrobat Distiller 8.1.

Syndicate content