itextsharp

How can I convert image url to system.drawing.image

怎甘沉沦 提交于 2019-12-17 22:33:19
问题 I'm using VB.Net I have an url of an image, let's say http://localhost/image.gif I need to create a System.Drawing.Image object from that file. Notice save this to a file and then open it is not one of my options also i'm using ItextSharp here is my code : Dim rect As iTextSharp.text.Rectangle rect = iTextSharp.text.PageSize.LETTER Dim x As PDFDocument = New PDFDocument("chart", rect, 1, 1, 1, 1) x.UserName = objCurrentUser.FullName x.WritePageHeader(1) For i = 0 To chartObj.Count - 1 Dim

Generate PDF based on HTML code (iTextSharp, PDFSharp?)

早过忘川 提交于 2019-12-17 22:25:11
问题 Does the library PDFSharp can - like iTextSharp - generate PDF files * take into account HTML formatting * ? (bold (strong), spacing (br), etc.) Previously I used iTextSharp and roughly handled in such a way (code below): string encodingMetaTag = "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />"; string htmlCode = "text <div> <b> bold </ b> or <u> underlined </ u> <div/>"; var sr = new StringReader (encodingMetaTag + htmlCode); var pdfDoc = new Document (PageSize.A4,

Reading PDF File Attachment Annotations with iTextSharp

蹲街弑〆低调 提交于 2019-12-17 20:39:18
问题 I have the following issue. I have a PDF with a XML file attached as annotation inside it. Not as embedded file but as annotation. Now I try to read it with the code from the following link: iTextSharp - how to open/read/extract a file attachment? It works for embedded files but not for file attachemts as annotations. I Google for extracting annotations from PDF and find out the following link: Reading PDF Annotations with iText So the annotation type is "File Attachment Annotations" Could

How to Generate Table-of-Figures Dot Leaders in a PdfPCell for the Last Line of Wrapped Text

拈花ヽ惹草 提交于 2019-12-17 20:29:41
问题 I have a Table of Figures generated using PDFPTable like so. -------------------------------------- |Caption|Figure Title | PP| -------------------------------------- | fig 1 |title text | 2 | --------------------------------|----| | fig 2 | This is a longer title| | | | text that wraps | 55 | -------------------------------------- | fig N | another title | 89 | -------------------------------------- I need to generate leader dots from the last line of text; it may have wrapped in the cell.

ITextSharp PDFTemplate FormFlattening removes filled data

帅比萌擦擦* 提交于 2019-12-17 19:44:57
问题 I am porting an existing app from Java to C#. The original app used the IText library to fill PDF form templates and save them as new PDF's. My C# code (example) below: string templateFilename = @"C:\Templates\test.pdf"; string outputFilename = @"C:\Output\demo.pdf"; using (var existingFileStream = new FileStream(templateFilename, FileMode.Open)) { using (var newFileStream = new FileStream(outputFilename, FileMode.Create)) { var pdfReader = new PdfReader(existingFileStream); var stamper = new

Difference between iTextSharp 4.1.6 and 5.x versions

无人久伴 提交于 2019-12-17 19:43:51
问题 We are developing a Pdf parser to be used along with our system. The requirement is such that, we store all the information on any pdf documents and should be able to reproduce the document as such (with minimal changes from original document). We did some googling and found iTextSharp be the best mate for our purpose. We are developing our project using .net. You might have guessed as i mentioned in my title requiring comparisons for specific versions of iTextSharp (4.1.6 vs 5.x). We know

iTextSharp is missing HeaderFooter class

泄露秘密 提交于 2019-12-17 19:27:29
问题 This is weird, I am currently using iTextSharp and I want to add a Header & Footer to my PDFs. In all the examples they simply create a new HeaderFooter() object. However, I have iTextSharp libraries all imported but the HeaderFooter is not defined. I've used Reflector to see if I can find out whereabouts the class is and its missing?! Does anyone know what has happened to this class? 回答1: Most of the examples refer to an earlier version of iTextSharp. For version 5+ of iTextSharp (which I

iText XML to PDF using latest version

守給你的承諾、 提交于 2019-12-17 19:24:36
问题 I found a few examples showing how to use the XML to PDF using a iText XML document. But they are all for the older version 4.x. Is there any examples or can someone post an example of the required/updated code to do the same in version 5.x? All the examples refere to code like this, but I can not find what to use to replace the ITextHandler class with in the new version. http://www.ridgway.co.za/archive/2005/07/31/itextsharpxmltopdfexample.aspx Document document = new Document(); PdfWriter

Not applying the CSS while generating PDF using iTextsharp.dll

丶灬走出姿态 提交于 2019-12-17 18:30:02
问题 I am generating PDF using iTextSharp.dll, but the problem is that I am not able to apply that CSS. I have one div: <div id="personal" class="headerdiv"> Personal Data </div> now my .aspx.cs code is like this: iTextSharp.text.html.simpleparser.StyleSheet styles = new iTextSharp.text.html.simpleparser.StyleSheet(); styles.LoadTagStyle("#headerdiv", "height", "30px"); styles.LoadTagStyle("#headerdiv", "font-weight", "bold"); styles.LoadTagStyle("#headerdiv", "font-family", "Cambria"); styles

How to add text in PdfContentByte rectangle using itextsharp?

↘锁芯ラ 提交于 2019-12-17 17:04:37
问题 I have created rectangle using PdfContentByte. Now I want to adda text inside this rectangle. How can I do this. If anybody have idea please share with me.My rectangle code is Document doc = new Document(new Rectangle(570, 924f)); PdfWriter writer = PdfWriter.GetInstance(doc,Response.OutputStream); PdfContentByte cb = writer.DirectContent; cb.Rectangle(doc.PageSize.Width -90f, 830f, 50f,50f); cb.Stroke(); 回答1: You are drawing a rectangle like this: PdfContentByte cb = writer.DirectContent; cb