pdf-generation

How to use wkhtmltopdf.exe in ASP.net [duplicate]

故事扮演 提交于 2019-11-26 22:32:35
问题 This question already has answers here : Calling wkhtmltopdf to generate PDF from HTML (11 answers) Closed 5 years ago . After 10 hours and trying 4 other HTML to PDF tools I'm about ready to explode. wkhtmltopdf sounds like an excellent solution...the problem is that I can't execute a process with enough permissions from asp.net so... Process.Start("wkhtmltopdf.exe","http://www.google.com google.pdf"); starts but doesn't do anything. Is there an easy way to either: -a) allow asp.net to start

How to implement custom fonts in TCPDF

ⅰ亾dé卋堺 提交于 2019-11-26 22:20:45
In TCPDF, there are only a few fonts to choose from, to create pdf files. I want to set Tahoma as my pdf font. How can I include Tahoma in TCPDF?? Nicola Asuni The latest TCPDF version automatically convert fonts into TCPDF format using the addTTFfont() method. For example: // convert TTF font to TCPDF format and store it on the fonts folder $fontname = TCPDF_FONTS::addTTFfont('/path-to-font/FreeSerifItalic.ttf', 'TrueTypeUnicode', '', 96); // use the font $pdf->SetFont($fontname, '', 14, '', false); For further information and examples, please check the TCPDF Fonts documentation page . NOTE:

Writing Arabic with PDFBOX with correct characters presentation form without being separated

陌路散爱 提交于 2019-11-26 22:18:14
问题 I'm trying to generate a PDF that contains Arabic text using PDFBox Apache but the text is generated as separated characters because Apache parses given Arabic string to a sequence of general 'official' Unicode characters that is equivalent to the isolated form of Arabic characters. Here is an example: Target text to Write in PDF "Should be expected output in PDF File" -> جملة بالعربي What I get in PDF File -> I tried some methods but it's no use here are some of them: 1. Converting String to

django - pisa : adding images to PDF output

混江龙づ霸主 提交于 2019-11-26 22:06:01
I'm using a standard example from the web ( http://www.20seven.org/journal/2008/11/pdf-generation-with-pisa-in-django.html ) to convert a django view / template into a PDF. Is there an "easy" way to include images (either from a url or a reference on the server) in the template so they will show on the PDF? I got the images working. the code is as follows: from django.http import HttpResponse from django.template.loader import render_to_string from django.template import RequestContext from django.conf import settings import ho.pisa as pisa import cStringIO as StringIO import cgi import os def

Embedding SVG in PDF (exporting SVG to PDF using JS)

倖福魔咒の 提交于 2019-11-26 21:51:23
The starting points: I don't have a server that can provide anything but static files. And I have an SVG element (dynamically created) in my <body> that I want to export to a vector format, preferrably PDF or SVG. I started looking at using the already existing lib jsPDF along with downloadify . It worked fine. Unfortunately, this does not support SVG, only text. I've read about the PDF format's possiblities to embed SVG images, and it seems to have been enabled since Acrobat Reader 5 (along with the ImageViewer plugin). But it doesn't work. I've tried with 3 different PDF readers without

Indentation in generated PDF using JasperReports

孤街浪徒 提交于 2019-11-26 21:50:15
问题 I have a piece of HTML stored in a database as: <ul> <li>Pretend you're talking to a busy colleague and have to sum up your entire question in one sentence: what details can you include that will help someone identify and solve your problem?</li> <li>Spelling, grammar and punctuation are important! Remember, this is the first part of your question others will see - you want to make a good impression. If you're not comfortable writing in English, ask a friend to proof-read it for you. </li>

How to calculate the string width in iText?

我的梦境 提交于 2019-11-26 20:35:31
问题 I am using iText to write a PDF. In some cases, I need to sign the PDF with the SetVisibleSignature function. With this function, we need to designate the rectangle that we will write the content into. But it's hard for me to calculate how wide the string will be, so that I can set the rectangle before setting a signature on the PDF. How can I calculate the string width in iText? 回答1: You can use BaseFont.getWidthPoint(String text, float fontSize) to get the width of the string in pt. Or put

How to use the browser's (chrome/firefox) HTML/CSS/JS rendering engine to produce PDF?

泄露秘密 提交于 2019-11-26 20:34:41
问题 There are nice projects that generate pdf from html/css/js files http://wkhtmltopdf.org/ (open source) https://code.google.com/p/flying-saucer/ (open source) http://cssbox.sourceforge.net/ (not necessarily straight pdf generation) http://phantomjs.org/ (open source allows for pdf output) http://www.princexml.com/ (comercial but hands down the best one out there) https://thepdfapi.com/ a chrome modification to spit pdf from html from I want to programatically control chrome or firefox browser

Generation PDF from HTML (component for .NET) [closed]

自古美人都是妖i 提交于 2019-11-26 20:27:33
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . Can you please point me to open source or a reasonably priced comercial product capable of generating PDF from HTML? 回答1: We currently use ABCpdf in one of our more complex applications. It has served us well and is not very expensive at all. I like that fact that I can send it raw HTML text and it will render

How to convert/save d3.js graph to pdf/jpeg

跟風遠走 提交于 2019-11-26 20:03:55
I'm working on a client-side/javascript function to save or convert an existing D3-SVG graph into a file. I've searched a lot and found some recommendations, mainly using canvas.toDataURL() . I have no <canvas> in my page, and instead using: d3.select("body").append("svg").... I've also tried to append the SVG to the <canvas> but nothing happens. Could you please help me to resolve this exception: Uncaught TypeError: Object #<SVGSVGElement> has no method 'toDataURL' Thank you Pavel Nikolov As pointed out by @Premasagar in this comment on this question Convert SVG to image (JPEG, PNG, etc.) in