pdf-generation

Unicode in PDF

末鹿安然 提交于 2019-11-27 04:12:13
My program generates relatively simple PDF documents on request, but I'm having trouble with unicode characters, like kanji or odd math symbols. To write a normal string in PDF, you place it in brackets: (something) There is also the option to escape a character with octal codes: (\527) but this only goes up to 512 characters. How do you encode or escape higher characters? I've seen references to byte streams and hex-encoded strings, but none of the references I've read seem to be willing to tell me how to actually do it. Edit: Alternatively, point me to a good Java PDF library that will do

Android : how to open pdf file from server in android [closed]

天涯浪子 提交于 2019-11-27 03:42:18
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . I'm new to android programming and I'm developing an application in android to open a PDF file from a server in my app. I've no idea about that. So please help me. How i can do this? Thanks in advance. 回答1: you

Need to merge multiple pdf's into a single PDF with Table Of Contents sections

丶灬走出姿态 提交于 2019-11-27 03:34:41
问题 Will have 50-100 single PDF's that we'll be generating with a php script. PDF's are generally grouped into groups of 10-20. Each group needs to have it's own Table of Contents or Index, and then there also needs to be a Master Table of Contents or Index at the beginning. Or if that is too difficult we could get away with a single Table of Contents at the beginning. What's the best way to go about this? Will we need to create the Table of Contents and then export that to PDF and append it to

iText / BouncyCastle throws “java.lang.VerifyError: class overrides final method equals”

牧云@^-^@ 提交于 2019-11-27 03:22:14
问题 We have an application that creates PDFs unsing jasperreports. It also manipulates said PDFs using iText after they have been created. We recently started using encryption on some PDF. That means before the app can handle the PDF after its creation, it has to be decrypted. While attempting to do so using iText's PdfReader(String path, byte[] password) I get the following exception: java.lang.VerifyError: class org.bouncycastle.asn1.ASN1Primitive overrides final method equals.(Ljava/lang

How to render an ASP.NET MVC View in PDF format

江枫思渺然 提交于 2019-11-27 02:56:19
I'm working with ExpertPDF's Html-to-PDF conversion utility for this question (although I'm open to other libraries if there's sufficient documentation). In short, I have a view that is formatted a specific way and I would like to render it as a PDF document the user can save to disk. What I have so far is a PrintService (which implements an IPrintService interface) and this implementation has two overloads for PrintToPDF(), one that takes just a URL and another that takes an HTML string, and both of which return a byte[]. I've only worked out the details of the second overload which requires

How to unit test a Python function that draws PDF graphics?

末鹿安然 提交于 2019-11-27 02:13:59
问题 I'm writing a CAD application that outputs PDF files using the Cairo graphics library. A lot of the unit testing does not require actually generating the PDF files, such as computing the expected bounding boxes of the objects. However, I want to make sure that the generated PDF files "look" correct after I change the code. Is there an automated way to do this? How can I automate as much as possible? Do I need to visually inspect each generated PDF? How can I solve this problem without pulling

Is it possible to justify text in PDFBOX?

删除回忆录丶 提交于 2019-11-27 01:52:42
Is there any function in PDFBOX API to make text justified or we have to do it manually?? and if manually then how to justify text using java(logic behind it) mkl This older answer shows how to break a string into substrings fitting into a given width . To make the sample code there draw the substrings in a manner to fill the whole line widths, replace as follows (depending on the PDFBox version): PDFBox 1.8.x Replace the final loop for (String line: lines) { contentStream.drawString(line); contentStream.moveTextPositionByAmount(0, -leading); } with this more elaborate one: for (String line:

put page number when create PDF with iTextSharp

随声附和 提交于 2019-11-27 01:48:10
I'm working with ASP MVC and i use iTextSharp to generate PDF's in my application. But now i have a problem: I printing lists and when exist more than one page, i want to show the page number (ex.: Page 1 to 4 ). I found some examples, but i think it is more complexes than i need to do (like exameple ). EDIT: I found this example 2 . I can count number of pages, but i cant print the number in pages. What i did: public ActionResult downloadListaISCC(DateTime? DataFimFiltro) { //Code to generate list to PDF //My document Document doc1 = new Document(); doc1.SetPageSize(iTextSharp.text.PageSize

Convert a PDF file to image

六月ゝ 毕业季﹏ 提交于 2019-11-27 01:21:26
问题 I wanted to convert PDF document into image. I was using Ghost4j. Problem: Ghost4J needs gsdll32.dll file at runtime, and I do not want to use the dll file. Question 1: is there any way, in ghost4j to convert image without the dll? Question 2: I found the solution in PDFBox API. org.apache.pdfbox.pdmodel.PDPagep have method convertToImage()` which converts PDF page to Image format. PDDocument doc = PDDocument.load(new File("/document.pdf")); List<PDPage>pages = doc.getDocumentCatalog()

Converting HTML to PDF (not PDF to HTML) using PHP [closed]

为君一笑 提交于 2019-11-27 01:20:29
I am a PHP developer and in one of my projects, I need to convert some HTML documents (about 30 to 50 pages) into PDF documents. My search has turned up the following possible solutions. Among them are some PHP libraries and some command line applications. Each has its own advantages and disadvantages. PHP libraries: fpdf (need more effort to convert) tcpdf (need more effort to convert) html2fpdf http://html2fpdf.sourceforge.net html2pdf http://html2pdf.fr/ dompdf http://code.google.com/p/dompdf/ (compared to other, works well) For each library, I have problems like: Takes a long time (more