Adding a pdf footer conditionally on certain pages in a multi-page pdf document - pdf

I have one web application which generates pdfs for each request.The data would be different in these pdfs based on user information.The number of pages can vary from 6 to 9.To construct the pdfs,i have multiple PdfPTables and each table has its own cells.Once i construct all the PdfPTables,as a final step i am adding the tables to the document.
Recently i have a requirement as,when ever there is a particular text then we need to add the footer to indicate the occurrence of this text in the respective pages.This can in 3 page or this can be 6 page or in both.I was thinking to figure out a way for this.
One of the approach i have is to identify this text at the time of adding to the PdfPCell and then generate a footer.But at this stage i dont have an idea as which page this would be in the document.I am letting the table to grow to the next page if it doesn't fit to the current page.
Another approach is to parse the entire pdf before sending the response back.Take one by one page,get the text and compare against the search text and if exists add a footer.Some how i feel this is a costly operation.
Please let me know if any of you have any suggestion to this.
Any help would be highly appreciated.
Thanks,

Related

Where do I find the field that determines whether a PDF has or is a fillable form or a scanned image?

A very quick question but I am at wits end trying to find it so I hope someone might have crossed this path. I have thousands of PDF's and need to know which of them are fillable forms or scanned images. I know I have seen a field that shows form : Acroform or something to that effect. Might this be in the info dictionary or do I need to go the XMP route? Is this the same location I might be able to tell if a PDF was a scanned image or page (I recognize that might have to be split into a separate question.
The goal is to loop through a series of pdfs and extract that data for a table.
Thank you

Multipage form using itext with Acrofield and Dynamic table

I'm new at working with itext and I'm looking for help.
I'm creating a PDF document based on a PDF template which contains a form with acrofields. This form is composed by some fields on top page and a table and has only one page.
The PDF document generated will have one or more pages depending on table's size (if size content extends predefined size, table should continue in the second page). Also every page should display fields on the top with the same information.
I've tried to solve it following "AddExtraTable" example, but I didn't get to keep the fields on top in all pages, only in the first one.
I've tried also to solve it with PdfCopy. This approach displays the fields on top in all pages but table content is not properly displayed.
Can someone help me?
PS: I have to use itext 2.1.7 because of project requirements.

Is it possible to use variables in a PDF document?

I want to make a editable PDF document – but I want to take it a step further.
Is it possible to create some editable fields on the first page where the user can put in personal information (name, age etc.) and have the document fill itself in where "name" is required?
I need this for some employment contracts and it would be alot faster if the user only needs to fill the information in once, print the PDF and sign it. :)
In PDF a single form field may have multiple widgets. By definition all these widgets have the same content.
E.g. have a look at thie sample document aFieldTwice.pdf. You see two fields. As soon as you edit one of them and press enter, the same content occurs in the other one.
This might be what you look for.

how to Delete blank page form pdf using VB.NET?

I am generating the PDF in that, i have merged first RDLC(Report) and second cristal report Total 2 pages are in my report,but after generating PDF it is showing three page, last page is blank so how to Delete blank page Using VB.NET... please help me out....
The reason for the third page is probably an element of the report overflowing invisibly somewhere. Try making it slightly less wide for starters and see if that helps.

Is this possible to break the pdf file smaller than page wise breaking?

I found there is a lot of tools available for breaking the Big PDF files into smaller one by splitting the original PDF file PAGE WISE.for example, if i have a 10 page PDF Document,then we can able to break the original pdf file into 10 pieces in page wise splitting.
But i want similar kind of tool that breaks the PDF file smaller than the Page wise splitting.That means,i need to split the PDF page into different documents based on any parameter like paragraph,section,element...
for example,
If my PDF file having 2 pages with 10 paragraphs then i would like to split the pdf file into 10 separate Pdf file based on paragraph parameter...
Also, I strongly believe pdf does not contain any structure like Open XML.But i also Suspecting
How the tools can able to break the pdf files in to small pdf files by splitting page wise? What kind of mechanism they are using for page wise splitting PDF File?
So, Is there any way to do my work? Please give me your valuable suggestion on this?
PDF is a vector based document description language. It's page based so in a way every page is independent from the next one. Splitting page wise is therefore pretty easy. Contrary to a raster image where you can extract small subsets independently in a pdf you have to render the whole page to know how a small subset looks like.
Say you have a Page (black) which contains a complex shaped object (here it is a line but it could be any text, shape, image, etc.) and you want to extract a subset (red). You would have to first find all the objects that produce visible output in the region of interest. Then you would have to modify them so they are rendered correctly (in this case calculate the green points from the blue points while preserving the shape of the object).
An easier approach would be to include the whole page and clip the viewing area to the dimensions of the region.
You could do this with pdfjam. Check the --trim/--offset/--delta command in conjunction with a custom paper size (Example 6,7 on the pdfjam website). You would still have to somehow calculate the coordinates of the region of interest though.