itextsharp

itext shatp nested <ul> <li> in PdfPcell not printing correctly using c#

人走茶凉 提交于 2020-01-07 06:57:53
问题 Here I have html text data <ul> <li><strong>sf f</strong></li> <li><strong>sd gmdslkg  </strong> <ul> <li><strong><span style="color:#FF0000">dsg </span></strong></li> <li><span style="color:#FF0000"><strong>ffg </strong></span></li> <li><span style="color:#800080"><strong>dfg g fdghdf</strong></span> <ul> <li><span style="color:#EE82EE"><strong>dsg  g</strong></span></li> <li><span style="color:#EE82EE"><strong>fdgh d</strong></span></li> <li><span style="color:#EE82EE"><strong>ghdf rfh <

How can I create buttons to add to a PDF file using iTextSharp?

≡放荡痞女 提交于 2020-01-07 05:06:07
问题 I'm creating "labels" and textboxes and checkboxes using iTextSharp, but my attempts to derive from that code to create buttons has not yet been successful. Here is how I'm creating textBoxes: PdfPCell cellRequesterNameTextBox = new PdfPCell() { CellEvent = new DynamicTextbox("textBoxRequesterName") }; tblFirstRow.AddCell(cellRequesterNameTextBox); . . . public class DynamicTextbox : IPdfPCellEvent { private string fieldname; public DynamicTextbox(string name) { fieldname = name; } public

how to re-sizing pdf content with iTextsharp

天大地大妈咪最大 提交于 2020-01-07 02:33:05
问题 I just need to resize page content in a pdf file, it's not related to Reducing file size I just need to reduce each page content which is one image to be able to print it as a booklet in landscape mode. So I need to reduce the height and the width of each page content. I'm using iTextSharp with c# 回答1: The easiest way might be to change the size of default user space units for the pages in question. The default user space units can be configured on a per-page basisusing the page dictionary

Is Document doc.Add(pdf) possible?

ぐ巨炮叔叔 提交于 2020-01-07 02:06:10
问题 I am trying to add pdf to another pdf. Document doc.Add(IElement) is what I know to do and I am having trouble adding the pdf. I tried adding image and that worked. How do I add a pdf file to my document? iTextSharp.text.Image img; foreach (var buf in List) { myDoc.NewPage(); img = iTextSharp.text.Image.GetInstance(buf); img.ScaleToFit(612f, 792f); img.Alignment = iTextSharp.text.Image.ALIGN_CENTER | iTextSharp.text.Image.ALIGN_MIDDLE; myDoc.Add(img); } 回答1: You can't use Document.Add() but

.net validation of pdfa file

时光怂恿深爱的人放手 提交于 2020-01-07 01:25:06
问题 I try to write a validation method in a VB project to check if a PDF file is PDF/A. I was playing with itextsharp.pdfa but i don't find a way to validate this. From here I understood that using itextsharp was not possible. Does itextsharp 5.5.5 include some functionalities like this? Are there other dll I can use in a vb.net project for this validation? 回答1: There currently is no such thing, but the European Union has mandated a project to build a "PDF/A Conformance Checker" as an open source

.net validation of pdfa file

可紊 提交于 2020-01-07 01:24:09
问题 I try to write a validation method in a VB project to check if a PDF file is PDF/A. I was playing with itextsharp.pdfa but i don't find a way to validate this. From here I understood that using itextsharp was not possible. Does itextsharp 5.5.5 include some functionalities like this? Are there other dll I can use in a vb.net project for this validation? 回答1: There currently is no such thing, but the European Union has mandated a project to build a "PDF/A Conformance Checker" as an open source

Highlight keywords in a pdf using itextsharp and render it to the browser

十年热恋 提交于 2020-01-06 19:32:28
问题 I have an existing pdf .I am using itextSharp to open the document and highlight keywords dynamically and when I save this into a file it works fine, but when I write it into a memory Stream and try to render it on the browser the highlights are not there. Here is the code public void SearchPDF() { //Create a new file from our test file with highlighting string highLightFile = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop), "Highlighted.pdf"); // Stream //Bind a

Reading PDF document with iTextSharp creates string with repeating first page

与世无争的帅哥 提交于 2020-01-06 19:07:13
问题 I currently use iTextSharp to read in some PDF files and parse them by using the string I receive. I have encountered a strange behavior with some PDF files. When getting the string back of a for example 4 page PDF, the string is filled with the pages in the following order: 1 2 1 3 1 4 My code for reading the files is as follows: using (PdfReader reader = new PdfReader(fileStream)) { StringBuilder sb = new StringBuilder(); ITextExtractionStrategy strategy = new SimpleTextExtractionStrategy()

Fit content on pdf size with iTextSharp?

不问归期 提交于 2020-01-06 15:05:30
问题 I'm having troubles with this, I managed to set the size of the pdf document to the one I needed (~3cm x ~7cm), but the content inside the pdf is using like a third of the space. And I need to use the whole available space. So, this is how it looks: http://s9.postimg.org/hrxsjjagv/fill.png See how all the content is centered in that little space in the middle. I tried setting the table widthpercentage to 100, with no luck. What can I do? 回答1: You currently have something like: Rectangle rect

MemoryStream looks like corrupt the file using iTextSharp

一笑奈何 提交于 2020-01-06 14:11:51
问题 I have two codes: string fileInput = @"c:\temp\input.pdf"; string fileOutput = @"c:\temp\saida.pdf"; PdfReader reader = new PdfReader(fileInput); Stream output = new System.IO.FileStream(fileOutput, System.IO.FileMode.Create); Document doc = new Document(); PdfCopy writer = new PdfCopy(doc, output); doc.Open(); PdfImportedPage pagina = writer.GetImportedPage(reader, 23); writer.AddPage(pagina); doc.Close(); output.Close(); It works very well! The file has 46.451 bytes But I need use Memory