itext

It is possible to cut an image of ItextSharp.Text.Image?

别说谁变了你拦得住时间么 提交于 2019-12-24 07:26:01
问题 I'm creating a pdf file from an large image, but my image is too large, and it does not fit in the only page. then i need split this image to create more pages. any idea? public FileResult ResultadoParaPdf(string file) { string fileStringReplace = file.Replace("data:image/png;base64,", ""); var image = Convert.FromBase64String(fileStringReplace); const int HorizontalMargin = 40; const int VerticalMargin = 40; using (var outputMemoryStream = new MemoryStream()) { using (var pdfDocument = new

Trying to copy source pdf to destination at specific Y position

孤人 提交于 2019-12-24 07:17:52
问题 I am testing a method which reads from an existing pdf called 55PREMIUMPAYMENTWARRANTY.pdf which has a couple of small paragraphs 3 lines each at the top. I am then trying to copy it to a new document at a different Y position using the canvas. I have called this method in a loop with various positions and surprised at the results. The Y position usually starts at 0 at the bottom left, yet it only shows on the new page if the Y value is a negative.. why is that? Usually if I was just writing

PDF scaling/importing pages that have been trimmed/cropped

徘徊边缘 提交于 2019-12-24 06:57:06
问题 I am currently in the process of writing an app that "formats" PDF's to our requirements, using iText 2.1.7. We basically take a portrait PDF, and scale down the pages, so we can fit 2 pages of the original PDF, on one landscape page of the new PDF. We also leave some space at the bottom of the page which is used for post processing. This process works 90% of the time as it should. However, we received a PDF that has been cropped/trimmed by the content department, and when we view this PDF in

sencha touch pdf generation form client side

随声附和 提交于 2019-12-24 06:51:21
问题 We are working on creating mobile app using sencha touch frame work. one of our requirements is when user hits view pdf, the user entered form details which stored locally has json format should be rendered and view as pdf and also it can be saved as a pdf locally. i found that itext is one of the java library which is widely used for pdf generation. but i couldn't find any article inter relating both sencha touch and itext. let me know is that a possible way or any other method available for

Replacing placeholders using iText in Java

半世苍凉 提交于 2019-12-24 06:38:30
问题 I have a PDF that contains placeholders like <%DATE_OF_BIRTH%>, i want to be able to read in the PDF and change the PDF placeholder values to text using iText. So read in PDF, use maybe a replaceString() method and change the placeholders then generate the new PDF. Is this possible? Thanks. 回答1: The use of placeholders in PDF is very, very limited. Theoretically it can be done and there are some instances where it would be feasible to do what you say, but because PDF doesn't know about

Save pdf template file to new pdf file after edit text in asp.net

这一生的挚爱 提交于 2019-12-24 05:55:17
问题 I have pdf file that contains some text that I want to replace with another piece of text (and save the file with new name.) Can I do that with iTextSharp? And how? Can you give me guide for it? 回答1: Generally speaking this is not possible. Check out this FAQ question which discusses the issue. The FAQ addresses iText (the Java version project from which iTextSharp was derived) but applies to iTextSharp as well. Keep in mind the comments on the (linked) example: /* This is only a partial

Get font height/weight from TextRenderInfo how?

为君一笑 提交于 2019-12-24 05:54:16
问题 When I parse an existing PDF using iText(Sharp), I create an object which implements IRenderListener which I pass into PdfReaderContentParser.ProcessContent() and sure enough, my object's RenderText() gets called repeatedly with all the text in the PDF. The problem is, the TextRenderInfo tells me about the base font (in my case, Helvetica) but I can't tell the height of the font nor its weight (regular vs. bold). Is this a known deficiency of iText(Sharp) or am I missing something? 回答1: the

Get font height/weight from TextRenderInfo how?

你离开我真会死。 提交于 2019-12-24 05:54:04
问题 When I parse an existing PDF using iText(Sharp), I create an object which implements IRenderListener which I pass into PdfReaderContentParser.ProcessContent() and sure enough, my object's RenderText() gets called repeatedly with all the text in the PDF. The problem is, the TextRenderInfo tells me about the base font (in my case, Helvetica) but I can't tell the height of the font nor its weight (regular vs. bold). Is this a known deficiency of iText(Sharp) or am I missing something? 回答1: the

iText as text Extracting/Reading from PDF on android

瘦欲@ 提交于 2019-12-24 05:36:12
问题 I'm having a problem with iText. Other people say that iText is for PDF Creation only? and it can not read or extract text from a PDF. is that true? If it is true then what are other options i can choose to EXTRACT text from PDF File and Save it on a Variable or Display it in Android device? If iText is capable of Extracting text from PDF, then HOW? 回答1: iText can extract text from PDFs. While it is true that it originated as a tool to create new and manipulate existing PDFs, it in the recent

Alignment issue with multiline text form fields in iTextSharp

一世执手 提交于 2019-12-24 04:56:14
问题 I have written an application to programatically fill out a form in a PDF template from a database and save the result to disk. Everything is working correctly apart from any multi-line text fields which are not rendering as expected. They should be top, left aligned with no gaps between lines. The result I get is here : However, when I click into the form field using any PDF reader, the field corrects itself to what I would expect. See : The code I am using is pretty boiler plate stuff.