iTextSharp XFA Flattening - Linethrough font style not being preserved - itext

I have an XFA form that was designed in Adobe LiveCycle that I am trying to flatten with iTextSharp. The linethrough font style is not being preserved in the flattened PDF. The text is still there, but it doesnt have the linethrough anymore, so I think this could potentially be a bug in the new XFA worker. Any ideas?

Related

FPDF Page wise style and size

I want to generate PDF using FPDF library, but I am facing one issue that I can only provide fixed style and size for all pages. But my requirement is that I should provide dynamic style and size in FPDF object.
What can I try to achieve this?
Use TCPDF
You can find many examples with more features than FPDF. You can use methods to publish some XHTML + CSS code, Javascript and Forms in a PDF format.
Some other features:
custom page formats, custom margins and units of measure;
automatic page header and footer management;
PDF annotations, including links, text and file attachments;
text rendering modes (fill, stroke and clipping);
multiple columns mode;
no-write page regions;
text stretching and spacing (tracking/kerning);
automatic page break, line break and text alignments including justification;
automatic page numbering and page groups;
move and delete pages;

single layer/flatten pdf file ITEXTSHARP

My Desktop App is creating a single page pdf with itextsharp library.There are 40 Passport size photos with names under it on a single page.
I need to flatten this pdf page (with 40 photos) as one Image while creating the pdf,currently there are 40 individual photos on the pdf page.I presume it would create around 80 layers by default which would take a very high time on ripping this file for printing on a press.
I dont want to make all the 40 images as one jpeg externally using GDI+ and then lay it in pdf.
I have seen many options using stamper and reading the created pdf file to flatten.Is there a way while creating the pdf i can create a flattened file.
Your understanding of flattening a PDF is completely wrong. The concept of flattening a PDF means: removing all interactivity. For instance: you have a PDF file with form fields. The content of these form fields can be changed in Adobe Reader. When you flatten such a form, you take away the form fields and replace the field content by actual content of the page. The result is a flat PDF in the sense that people can no longer change the content of the fields.
You presume that having multiple pictures on a single page in a PDF means that there are multiple layers in that PDF. Your understanding of layers in a PDF is completely wrong. Layers is a word that is used in many different contexts. For instance, when working with optional content groups (OCG), people often refer to layers.
The concept of layers as you may know it from Photoshop doesn't really exist in PDF. Content is added in a stream. Whatever content is added first, can be covered by content that comes after. You want to pro-process the content by removing all the content that isn't visible in the hope that the PDF will be printed faster. You want to achieve that by replacing many different image objects by one image.
Your assumption that this can be done with iText is wrong. iText doesn't convert PDF to an image. This is outside the scope of what iText is written for.
If you want to add X images as 1 single image using iText, then you have to process the X images into 1 single image before you add the images to the PDF. You need image manipulation software, because iText won't do what you're asking for.

how to keep pdf format while using itextSharp

I am new in using itextsharp: i searched for how to keep pdf formatting while using itextsharp but found none. is there anything new about keeping pdf format in text?
please help. I want to keep format of page number and fonts of text headers and sub headers as in chapter heading etc

Create fillable PDF from PDF

I'm trying to create an editable PDF from an existing PDF. There are Textbox fields, however, my PDF has got images similar to checkbox. The Acrobat Pro is not detecting those controls as checkboxes. There are around 200 checkboxes in my PDf which is tedious to replace them with checkbox controls manually. Is there a way to identify those images as checkboxes programmatically and create the controls automatically?
If you use the Premium version of OmniForm you can convert to PDF, then do your final editing in Acrobat. Much easier than trying to build it using the Acrobat Pro 9 Form Wizard to create forms from paper or electronic documents.
No, there isn't.
Try Omniform from Scansoft/Nuance .. for some people it works better at detecting checkbox like structures on the image than Acrobat Pro 9.

Modify character spacing in a PDF form field

This question was originally posted by esilver but he seemed to answer his own question, which then didn't make any sense. In his post he mentioned 'combing' of which I have found no reference to.
Here is what his question is and my slight amendment is at the bottom:
esilver's question:
"I'm trying to build a web app to programmatically fill out a PDF form. I am going to configure my form first in Adobe Acrobat, then write a Java app with iText to fill out all the form fields via user input from the web. The base form I need to fill out comes from the US government. They created form fields with extremely large kerning (character spacing) values I need to change. However, there appears to be no way to modify this value in the Acrobat UI.
Does anyone know how to manipulate character spacing on form fields in Acrobat 8.0 for Windows? I could try to use iText to programmatically manipulate the kerning of the original document, but this would be much more tedious.
Thanks!"
His answer:
"I believe I figured this out: kerning is called "combing" in acrobat, and each of the form fields have been "combed". The strange thing is this option isn't checked when I view the properties of the form field, but "combing" is the behaviour I was attempting to replicate."
My amendement:
I am using Acrobat Pro 9 to generate this form. Now my question is: Does anyone know how to manipulate character spacing on form fields in Acrobat Pro 9 for Windows?
It sounds like you're referring to comb fields, not kerning. Kerning is adjusting the spacing between characters so that letters like AV can be pushed closer together and still look good.
A comb field is a field where each letter has a specific visible box that it fits into. I believe it's named a comb field because the spacing resembles the teeth of a comb. Comb fields are common on government forms and are used to encourage you to print your answer.
Comb fields don't make a lot of sense for an electronic form, but sometimes the electronc form has to exactly match the print form for legal reasons.
Try loading the form in LiveCycle Designer, which comes with Acrobat. If it's an XFA form (vs an AcroForms form), then you'll be able to edit the kerning in Designer.