itextsharp

Modifying existing pdf elements (particularly images)

I am reading in template PDFs, customizing them, and appending pages before outputting the final document. What I want to do is modify the elements in the template I load before I append it to the output. In particular I want to hide or remove images (and potentially other elements). I'm not even sure if elements in the imported pag...

Get PDF page size with iTextSharp

I have a PDF document that I just received via file upload (InputFile). I'd like to use iTextSharp to check it's page size before proceeding. For example, the size of a pdf when you go to file > Properties > Description Tab > Page Size (in acrobat). Any advice on how I can do that? THANKS! ...

How to convert a PDF from HTML using C#?

Hi, Can anyone tell me how to convert a PDF document from an HTML code using C#? I'm using itextsharp 5.0.2 dll. I have come across this forum. I didnt find any solution so far. And some of them mentioned iTextSharp.HtmlParser but i cannot find such kind of class in my version of dll. In which version should i need to use to achieve my ...

problem with itext pdf image extraction !

Hello. I have a problem in my image extractor code. Any suggestions are appreciated. I first get a stream from the PDF and check each of the objects, if an object is an image I save it. The code is working properly and I can get all the images in the PDF. Some images are unusual because part of the image missing (hidden/erased) and ima...

iTextSharp Textfield setting the font to Bold

For a textfield object, I would like to change the style to bold. I have already created the arial font since it is not a default font for the BaseFont object. Apparently the TextField object only takes the BaseFont as a valid font. I was wondering how would I change the style of the font that I have assigned to my textfield to bold. Is ...

How to make duplicate pages of one page?

I am using itextsharp in c#. i want to copy one page in multiple copies. and add some text at desire position. ...

vb.net: how do i build to just one file??

i did a build in vb.net and got one exe file however, when a user runs the file, it says it is missing one of the libraries (itextsharp). so the question is, if there is actually a build option in vb.net, why does it not include the library in the same exe file? ...

licensing consideration of using itextsharp in a saas project

Hi I might need to use iTextSharp for a project I'm working on. I'd prefer to use the latest version so I'm trying to understand what the full implications of the GNU Affero General Public License is. I've read though the FSF documents but still have questions. I'm not going to modify it in any way, just call it from a component (window...

iTextsharp - PDF file size after inserting image.

I'm currently converting some legacy code to create PDF files using iTextSharp. We're creating a largish PDF file that contains a number of images, which I'm inserting like so: Document doc = new Document(PageSize.A4, 50, 50, 25, 25); PdfWriter writer = PdfWriter.GetInstance(doc, myStream); writer.SetFullCompression(); doc.Open(); I...

iTextSharp - use a custom image for a list bullet symbol

I'm trying to use a custom image as a bullet symbol in a list, but it's not showing up (there's empty space where the bullet should be). I get no errors and the PDF loads fine; the bullet just doesn't show. Relevant code: // the 'content' var is a PdfContentByte // passed to the function this code is in var imagePath = Server.MapPath...

Difference between PageNumber and PageCount in iTextSharp document

Where is the difference between properties PageNumber and `PageCount in com.itextpdf.text.Document ? The documentation I have found on this is not very clear. *Note:*Same properties are also in class PdfWriter so I guess that those in Document only calls those in PdfWriter. ...

Stack Overflow exception on htmlparse method of iTextSharp.dll version: 4.0.4

I am geting stackoverflow exception on htmlparse method when I have any image in my html file. I am using iTextSharp 4.0.4 dll. I also tried iTextSharp 5.0.2 dll. In that i can not find htmlparse method at all. Here under is my code: Document doc = null; XmlTextReader reader = null; MemoryStream msHtml = null; ...

Generate PDF w/iTextSharp from database items

Deleted, not a valid scenario. ...

iTextSharp - Text wrapping around another textblock

I'm building up a PDF using iTextSharp. I've seen a number of code example for putting an image into the flow of the document and having the text wrap around it (e.g. http://www.geek-tutorials.com/java/itext/itext_image.php). What I want to do is have a text block that sits on the right hand side of my page, but I'd like the rest of ...

itextsharp - adding an entire Page

Hi I'm using itextsharp and i've sucefully added paragraphs but now i'm trying to add an entire Form. My idea was to add an Form and fill him with some controls that i've on Page or maybe just add the controls individually. How can i add controls? Thanks ...

iTextSharp not converting aspx( html )to pdf

Hi, I want to convert one of my asp.net reports to pdf as it is. However, I thought iTextSharp would be the ideal solution but it is not converting the report properly. My conversion code is as follows Public Function DotNetConvert() Dim strFileName As String = HttpContext.Current.Server.MapPath("map1.pdf") ' strFileName ...

Rotating PDF in C# using iTextSharp

Hello, I am using the below function to split the pdf into two. Though it is spliting the pdf, the content is appearing upside down. How do I rotate it by 180 degrees. Please help. below is the code for the same private static void ExtractPages(string inputFile, string outputFile, int start, int end) { // get input do...

itextSharp.PdfPTable - changing indentation of series of tables

I am have to print out a series of data objects where each consists of a changing number of label-value pairs so the ideal structure for that is obviously the PdfPTable. And so far everything works fine with it. But the data objects are in a hierarchical relationship to each other and the hierarchy level needs to be expressed by differen...

Form Field font in iTextSharp

How to get the font of some Form Field in existing PDF using iTextSharp? ...

How do I scale a pdf page while maintaining orientation with iTextSharp

How do I scale a pdf page, while maintaining rotation in itextsharp? I have the following, but I lose rotation: public static void ScaleToLetter(string inPDF, string outPDF) { PdfReader reader = new PdfReader(inPDF); Document doc = new Document(PageSize.LETTER); Document.Compress = true; PdfWriter...