StackOverFlowException while trying to generate multiple PDFs using iTextSharp - itext

I'm using iTextSharp to generate PDF files from a console application. And I wanted to add a footer to the PDF report. Hence as suggested, I have created a Footer class which inherits PdfPageEventHelper class and overiding the OnEndPage event. Then I have the assigned the instance of this footer class to the PageEvent of my Writer object. Now everything works fine and the PDF file is getting generated.
But I face the problem when I want to generate multiple PDF files in a loop. When I try to create PDF files in a loop, I'm getting StackOverFlowException in the onEndPage event after generating few files. Any suggestions to get rid of this exception? Thanks in Advance.
Regards,
Muthiah

Related

How to add custom properties to PDF document in Jasper Reports?

I need to put some custom properties into PDF document. Is possible to do that on JRPdfExporter class or somewhere else (filler etc) ? I can't find this.
Update:
I found only PdfStamper.setMoreInfo() method from iText. It works on exising pdf file only.

File Upload not working after moving form field

I have a large form with a image upload field working ok.
Field is defined in model as:
$this->add('filestore/Field_Image','thumbnail_id');
Then I created two tabs inside form:
$tabs=$form->add('Tabs');
$main=$tabs->addTab('General');
$design=$tabs->addTab('Design');
And moved image field to design tab:
$design->add($form->getElement('thumbnail_id'));
Now I can't upload files. When I try I get the following javascript error
Error: cannot call methods on atk4_form prior to initialization; attempted to call method 'submitPlain
Is there any other way to move the field or have upload working again after moving it?
I was trying to use the same method ($design->add($form->getElement('my_element'));) to move a slider into another place on the page. That didn't work - I think it was because the slider input field is not placed on the page the same way as other input fields.
So I tried with the jQuery appendTo-method (I found the hint in a comment from romanish in a documentation page). That worked. But then I experienced the same problem as you - and in the end I gave up and solved the problem by editing the slider-class page.
So I can't help you, sorry, but I guess this points out that there is a general problem related to getting input from moved form elements.

Repeat Image in fpdf without creating another instance

I know in PDFs one can have an image repeated (appear in the PDF more than once) without having multiple instance of the image (i.e. the image data appears in the file only once).
Is there a way to do this with fPDF? I am generating a PDF containing sheets of cards; each has artwork. The artwork, which can be 300dpi, may appear in the file thousands of times.
FPDF will only embed the image once.
From http://www.fpdf.org/en/doc/image.htm
Remark: if an image is used several times, only one copy is embedded in the file.
fPDF does this always. It checks to see if the filename has been added already and creates a reference to the original rather than re-add the image data.
I had used a report designer where this kind of reference had to be made explicitly and I erroneously expected fPDF would work similarly.

Dynamic controls in PDF Adobe Cycle

Does anyone know how to add control (example: field) on-run in PDF? I'm using Adobe LiveCycle ES2; need that piece of JavaScript....
Thank you all -
I previously tried to do something similar but have never been able to find a method of dynamically creating an object on a form.
You can use the addInstance command to add an instance of a new form and it's possible to add additional rows to a table but other than that, the only method I have found that works is to add the objects from the toolbox and then show/hide them.
It does mean that you're adding additional objects to the form but if used correctly this doesn't really have too much affect on the file size but it does involve extra coding.

Parsing pdf to populate tableview

I am working on an app.The requirement is I need to populate the tableViewCells based on a pdf file.Like for example the headers of the table view will be a topic name from pdf and the contents will be the data inside the header.
I tried googling out but didn't find anything useful.Earlier I thought of parsing the pdf but this approach doesnot seems to be useful because i didn't find any pdf parser useful.
The last approach I thought is adding the contents in a plist file and parsing that plist,but i know this is not best way to do it.
So guys please suugest some better approach.
Thank you