pdf-generation

Writing Arabic in pdf using itext

限于喜欢 提交于 2019-12-04 07:23:31
I am generating PDF file using itext lib. I want to write Arabic words. When i run the below code, The words characters are reverse displayed. The used code : PdfContentByte cb = docWriter.getDirectContent(); BaseFont bfBold = BaseFont.createFont("assets/arial.ttf", BaseFont.IDENTITY_H, BaseFont.EMBEDDED); createHeadings(cb, document.leftMargin(), 70, "السعر الاجمالي: " + tprice + " L.E."); . . . private void createHeadings(PdfContentByte cb, float x, float y, String text){ cb.beginText(); cb.setFontAndSize(bfBold, 10); cb.setTextMatrix(x,y); cb.showText(text.trim()); cb.endText(); } This

Export HTML to PDF (C++, Windows)

女生的网名这么多〃 提交于 2019-12-04 07:16:40
I am looking for a redistributable component to convert HTML to PDF. I would - at the moment - like to avoid using a "PDF printer", as this requires a printer installation and some user "playing around" in the printers panel might break that feature. The HTML is available in a Browser control or as external file. The HTML is normally fairly simple, but customers can create their own templates, so a "good range" of HTML should be supported. Should be accessible for an automated process from C++ - DLL / COM / external executable with command line support are all fine. Commercial is fine, but in

Any font for generating pdf that will handle Chinese, Cyrillic… ?

橙三吉。 提交于 2019-12-04 06:10:40
I'm creating generator of pdf documents in Ruby on Rails with Prawn gem and I came up with issue that when I have Chinese, Japanese and Cyrillic chars they are displayed incorrectly. I googled out that it's because "when I'm generating font I need to specify, what font should pdf text be rendered with" . Now this isn't the issue, but the fact that my documents will include all different possible chars that gTLD supports . Question 1: Do you know any font for generating pdf documents that will include as many as possible chars (Asian, Europe, Symbols, ...)? Ideally all chars that gTLD supports.

How can I create a PDF file in classic ASP?

a 夏天 提交于 2019-12-04 05:59:36
Is there any way to generate PDF files from classic ASP? I have a bunch of user-entered data that needs to be turned into a PDF that the user can download. How can I do this? OpenOffice allows exporting documents to PDF, so could this somehow be leveraged? I played around a bit with this (Persits ASPPDF): http://www.asppdf.com/ Maybe running an external application that could be using CrystalReports... and you just pass it as an xml? That's how i would do it... (lazy mode) See a full list of PDF components here: http://www.aspin.com/home/components/document/pdf Many of them are free. It is

Creating PDF from Word (DOC) using Apache POI and iText in JAVA

让人想犯罪 __ 提交于 2019-12-04 05:58:15
I am trying to generate a PDF document from a *.doc document. Till now and thanks to stackoverflow I have success generating it but with some problems. My sample code below generates the pdf without formatations and images, just the text. The document includes blank spaces and images which are not included in the PDF. Here is the code: in = new FileInputStream(sourceFile.getAbsolutePath()); out = new FileOutputStream(outputFile); WordExtractor wd = new WordExtractor(in); String text = wd.getText(); Document pdf= new Document(PageSize.A4); PdfWriter.getInstance(pdf, out); pdf.open(); pdf.add

Splitting HTML page so Printer splits it into separate pages

余生长醉 提交于 2019-12-04 05:48:48
I am planning price list available for clients online and I was thinking about simple very long page or div container with some anchor links aside to help jump to different products. However in case someone wants to print off just price list with certain products I don't want all the pages to print off but only current one. Is there any print breaking character or tag? Just in case someone has better idea all I want to achieve is having price list in html to change it in one place but still be able to convert separate product price lists into PDF files for emailing purposes of particular

How to add a table as a header?

送分小仙女□ 提交于 2019-12-04 05:45:30
问题 I am working with iTextSharp trying to add an header and a footer to my generated PDF but, if I try to add an header that have width of 100% of my page I have some problem. So I have do the following things: 1) I have create a class named PdfHeaderFooter that extends the iTextSharp PdfPageEventHelper class 2) Into PdfHeaderFooter I have implemented the OnStartPage() method that generate the header: // write on start of each page public override void OnStartPage(PdfWriter writer, Document

Multiple XMLs to PDF: best approach

a 夏天 提交于 2019-12-04 05:44:42
I have some XML files which are used to generate my webpages, however I need to be able to allow the user to select a number of pages then combine them into one PDF. This PDF needs to have different styling to the actual web page (the content is kept in XML files ;) ). p.s. the PDF must have table of contents... and will include images taken from the website. You would use a library like iText or iTextSharp to build a PDF using your content. Write an XSLT stylesheet which transforms your XML files to XSL-FO and then use an XSL-FO implementation (e.g. Apache FOP ) to produce PDF. I use Prince

pdf.js failing on getDocument

狂风中的少年 提交于 2019-12-04 04:49:23
browser: Chrome environment: grails app localhost I'm running a grails app on local host (which i know there's an issue with pdf.js and local file system) and instead of using a file: url which i know would fail i'm passing in a typed javascript array and it's still failing. To be correct it's not telling me anything but "Warning: Setting up fake worker." and then it does nothing. this.base64ToBinary = function(dataURI) { var BASE64_MARKER = ';base64,'; var base64Index = dataURI.indexOf(BASE64_MARKER) + BASE64_MARKER.length; var base64 = dataURI.substring(base64Index); var raw = window.atob

English text extracted using itextpdf is not understandable

删除回忆录丶 提交于 2019-12-04 04:22:33
问题 I'm trying to extract and print english text out of a pdf on console. Extraction is done through itextpdf API using PdfTextExtractor class. Text i'm getting is not understandble. May be some language issues I'm facing. My intent is to find a particular text within a PDF and replace it with some other string. I started with parsing the file to find the string. Following code snippet represents my string extractor: Document document = new Document(); PdfWriter writer = PdfWriter.getInstance