itextsharp

A good guide book or API doc for iTextSharp? [closed]

人走茶凉 提交于 2019-12-19 12:28:13
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Can anyone suggest me a a nice book or API document for iTextSharp , I have been struggling while understanding the lib and have

A good guide book or API doc for iTextSharp? [closed]

不打扰是莪最后的温柔 提交于 2019-12-19 12:28:08
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 7 years ago . Can anyone suggest me a a nice book or API document for iTextSharp , I have been struggling while understanding the lib and have

How to create a rounded corner table using iText\iTextSharp? [duplicate]

谁说胖子不能爱 提交于 2019-12-19 10:25:40
问题 This question already has an answer here : How do I round the corners of an iTextSharp table border? (1 answer) Closed 5 years ago . I have to create a table having rounded corners, something like it: Can I do it with iTextSharp? 回答1: This is done using cell events. See the Calendar example from my book (Java / C#). Make sure that you don't add any "automated" borders to the cell, but draw the borders yourself in a cell event: table.DefaultCell.Border = PdfPCell.NO_BORDER; table.DefaultCell

ITextSharp - merge two pdfs in a single page

血红的双手。 提交于 2019-12-19 08:14:37
问题 i will put this question in simple terms. I have this pdf: _____ |abcd | | | | | |_____| And this one: _____ |1234 | |4567 | | | |_____| I want to merge them to get: _____ |abcd | |1234 | |4567 | |_____| It is possible using iTextSharp or any other free tool? Thanks in advance 回答1: this is an old question... but if someone gets in here again my solution was this... i did this hard coded for two pages into one page so this is the basics first i rotated the two PDFs after that i merge them

itextsharp and images sizes

自古美人都是妖i 提交于 2019-12-19 07:23:14
问题 I am creating a single pdf page with 6 images in a table in separate cells, even though I am setting the images height and width on the server side exactly the same with ScaleToFit the images sizes are not the same on the pdf page. Is there anyway to get all the images the exact same size? PdfPTable table = new PdfPTable(3); table.HorizontalAlignment = Element.ALIGN_CENTER; table.WidthPercentage = 100; table.TotalWidth = 698.5f; table.LockedWidth = true; table.SetWidths(new float [] {1,1,1});

Set AcroField Text Size to Auto

泄露秘密 提交于 2019-12-19 04:04:51
问题 Using itextsharp , I'm attempting to set the font size of my form's text fields to auto . I'm currently doing something like this: Object d = 0.0; PdfReader reader = new PdfReader(path); byte [] pdf; using (var ms = new MemoryStream()) { PdfStamper stamper = new PdfStamper(reader, ms); AcroFields fields = stamper.AcroFields; foreach (var f in fields.Fields.Keys) { fields.SetFieldProperty(f, "textsize", d, null); } } But I'm getting the following error: System.InvalidCastException: Specified

Set AcroField Text Size to Auto

拥有回忆 提交于 2019-12-19 04:04:05
问题 Using itextsharp , I'm attempting to set the font size of my form's text fields to auto . I'm currently doing something like this: Object d = 0.0; PdfReader reader = new PdfReader(path); byte [] pdf; using (var ms = new MemoryStream()) { PdfStamper stamper = new PdfStamper(reader, ms); AcroFields fields = stamper.AcroFields; foreach (var f in fields.Fields.Keys) { fields.SetFieldProperty(f, "textsize", d, null); } } But I'm getting the following error: System.InvalidCastException: Specified

itextsharp how to add a full line break

痴心易碎 提交于 2019-12-19 04:02:45
问题 I use itextsharp and i need to draw a dotted linebreak from left to right of the page(100% width) but don't know how. The doc always has a margin left right. Please help var pageSize = PageSize.A4; if (_pdfSettings.LetterPageSizeEnabled) { pageSize = PageSize.LETTER; } var doc = new Document(pageSize); PdfWriter.GetInstance(doc, stream); doc.Open(); //fonts var titleFont = GetFont(); titleFont.SetStyle(Font.BOLD); titleFont.Color = BaseColor.BLACK; titleFont.Size = 16; var largeFont = GetFont

CSS styles not being applied to PDF with iTextSharp

ぃ、小莉子 提交于 2019-12-19 02:25:28
问题 I am attempting to convert a portion of my webpage to pdf using iTextSharp, and while the pdf generation is working correctly, none of the css styles are being applied. I've tried applying the styles one at a time, but that doesn't seem to work. This is what I've come up with so far: //Get the portion of the page to convert. StringBuilder sb = new StringBuilder(); print_div.RenderControl(new HtmlTextWriter(new StringWriter(sb))); string html = sb.ToString(); //Generate a random filename to

Convert PartialView Html to String for ITextSharp HtmlParser

痞子三分冷 提交于 2019-12-18 17:28:07
问题 I've got a partial view, i'm trying to use ITextSharp to convert the html to pdf. How can I convert the html to string so I can use ItextSharps HtmlParser? I've tried something like this with no luck...any ideas?: var contents = System.IO.File.ReadAllText(Url.Action("myPartial", "myController", new { id = 1 }, "http")); 回答1: I have created a special ViewResult class that you can return as the result of an Action. You can see the code on bitbucket (look at the PdfFromHtmlResult class). So what