Question checking and merging '.pdf'-files with itextsharp


New member
Nov 27, 2013
Programming Experience
With a tool I'm collecting emails (as file) and their attachments from outlook. The files are, as far as they are not ".pdf"-files, converted to ".pdf"-files and afterwards merged to one whole ".pdf"-file. Therefore I'm using itextsharp.
My codes works basically, but far from perfect. The far from perfect part does concern for example ".pdf"-forms with data content which gets lost (especially the checked-information of radio buttons) when the forms are merged with the other files. Further there might be several possible orientations and sizes (letter, DIN A0/1/2...4 and the like) of the ".pdf"-files' pages, which should all be oriented to "portrait" respectively DIN A4. The orientations can concern the whole page or just the content of the page.
Because I'm no specialist in drafting code and in fact do not really know how one uses itextsharp I did collect several code snippets I found on the internet and did adapt them to my code. Additionally I'm "shortening" some of the files, e.g. when they have got more than a number of pages I'm "cutting" off all but two pages, and I'm adding information on the pages, e.g. the filename and that the original ".pdf"-file did have more pages. The ".pdf"-files to be merged are all collected in one folder on hard disc and the file paths are collected in a list of string.
What could be a proper way to handle all this using itextsharp? Where could I find hints to change my code to a version a little closer to perfect?

Latest posts

Top Bottom