pdf-generation

How to configure iText to support Asian characters?

久未见 提交于 2019-12-05 09:13:48
My Java application creates PDFs using iText. Sometimes the content is Asian, which does not work. The Asian characters are not visible. I found iTextAsian.jar on the iText download page, but don't know how to use it. The goal is to use my favorite font as default. But when a character is not available an other font is used for this character. I have read, iText can select fonts that way automaticaly, but how to configure this? I also want all required fonts to be included in the PDF, so users don't have to install Asian fonts on their computers. You can define a "FontSelector" and then add

Android create and print pdf from layout view

南笙酒味 提交于 2019-12-05 07:55:22
I am trying to create PDF file from xml layout view. I have a listview in that layout, adding items and setting height based on child. PDF is creating but not filling the whole page. What I have tried is, PdfDocument.PageInfo pageInfo = new PdfDocument.PageInfo.Builder(2250, 1400, 1).create(); // start a page PdfDocument.Page page = document.startPage(pageInfo); // draw something on the page LayoutInflater inflater = (LayoutInflater) getSystemService(Context.LAYOUT_INFLATER_SERVICE); View content = inflater.inflate(R.layout.pdf_layout, null); content.measure(2250, 1400); content.layout(0,0,

how to convert dynamic php file to pdf?

让人想犯罪 __ 提交于 2019-12-05 07:52:51
问题 I try to convert dynamic php database file to pdf. I try with DOMPDF, but I have a problem with defining the string. I'll explain: Here is a 'hello world' script for dompdf: require_once("dompdf_config.inc.php"); $html = '<html><body>'. '<p>Hello World!</p>'. '</body></html>'; $dompdf = new DOMPDF(); $dompdf->load_html($html); $dompdf->render(); $dompdf->stream("hello_world.pdf"); The thing is that instead of a simple '<html><body>'. '<p>Hello World!</p>'. '</body></html>' I have a long php

iTextSharp and special characters (slovak graphemes)

半腔热情 提交于 2019-12-05 07:45:50
I am having trouble with some special slovak characters (for example č, ň and ť). They are disappearing in the itextsharp generated pdf. From what I've been able to find, this problem has to do with encoding of my BaseFont . Currently I am using this: BaseFont.CreateFont(BaseFont.HELVETICA, iTextSharp.text.pdf.BaseFont.CP1250, BaseFont.NOT_EMBEDDED) Someone suggested that this should work: BaseFont.CreateFont(BaseFont.HELVETICA, iTextSharp.text.pdf.BaseFont.IDENTITY_H, BaseFont.NOT_EMBEDDED) But it throws this exception error: System.ArgumentException was caught Message='Identity-H' is not a

Generate HTML To PDF Control for the .NET application [duplicate]

限于喜欢 提交于 2019-12-05 07:33:22
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Generation PDF from HTML (component for .NET) Has anyone used any open source or paid .NET Control which does the conversion job from html to pdf file? At the moment, i am using Winnovative convertor control. But it has a performance limitation during the generation of bulk pages (like more than 1000) in the pdf. The limitation comes when we use bigger images in the html content. From last 4 months i've been

Custom page size output in XPS from WPF report

荒凉一梦 提交于 2019-12-05 07:26:29
问题 I have a WPF report which draws the report content in a custom page size (we can consider it as a A4, the problem is the same), if I send the output to a printer (physical or virtual like PDFCreator) my custom page size are correctly preserved for each page. But when I output it as XPS format the pages are adapted to Letter page size. How to preserve my custom page size when outputting a WPF report to XPS ? MY FINAL GOAL: Is to have a PDF from WPF, and my approach is to convert a XPS to PDF

Reorder pages in a pdf file using itextsharp

我的未来我决定 提交于 2019-12-05 06:16:26
问题 I'm trying to reorder several pages in a PDF file. I found some code in a blog but couldn't get it to work. I have a two page pdf, and I want to get the last page to appear as first. I always get an exception saying that page number has to match with order. When I checked the document object, it shows 0 pages. But the PDF passed into has two pages. public void reOrder(string inputFile) { Document document = new Document(); FileStream fs = new FileStream(inputFile, FileMode.Open); PdfWriter

Bold not working in Jaspersoft Studio for fonts other than sans serif

吃可爱长大的小学妹 提交于 2019-12-05 06:10:58
In Jaspersoft Studio I have created a report where I want to display title in bold. If I use sans serif font then it is working correctly. If I use other fonts, bold is displayed in the preview of Jaspersoft Studio, but is not showing when the report is run in the Jasper server. Please help. You need to create a jasper fonts extension jar and place it into your classpath both compile-time (while compiling the jrxmls) as well as run-time (while running reports). Here is how the jar (e.g. jasperreports-fonts-5.5.2.jar ) should look: The jasperreports_extension.properties should contain few

How to set DPI (dots per inch) in PDFsharp

会有一股神秘感。 提交于 2019-12-05 06:01:01
Is there any way to set DPI (dots per inch) in case of PDFsharp? Thanks No, PDF files are vector files that have no DPI. If your question is about images stored in the PDFfile: PDFsharp stores images as they come. PDFsharp does not (yet) resize images to lower DPI to reduce the file size. Your application knows which image will be used where and at which size, so you should reduce the raster images to the DPI (*) you need before using them with PDFsharp. Please note that images will be included in the PDF only once, even if they are drawn several times - and they can be drawn at different size

Docx to pdf using openoffice headless way too slow

你说的曾经没有我的故事 提交于 2019-12-05 05:38:40
I've been using PHPWord for docx files generation. And it's been working great. But now I have the need to also make available some of those files on a pdf version. After a few research I found PyODConverter which use OOo. Seemed quite a good option since I don't want to depend on third party web services. I tried it out on my machine and it works fined, so I've applied it on my server as well. It took a little longer but I've managed to get it working on there too. There is however an (bad) issue. On the server this takes about 21 seconds to get it done, while on my machine it doesn't take