wkhtmltopdf

Creating PDFs with django (wkhtmltopdf)

百般思念 提交于 2019-11-28 21:33:38
Could someone please provide me with a comprehensive example of how to get a view in django to return a PDF using wkhtmltopdf . There are limited number of examples that come with django-wkhtmltopdf and they presume a level of knowledge I just don't have. I have looked through the source code but I can't make heads or tails of how to use it (for example whats the difference between PDFTemplateView and PDFTemplateResponse ?!?) I would be very grateful for any help. BTW(I'm using templates for the header and footer as well) EDIT def some_view(request,sID): something = get_object_or_404(Something

Squared characters issue on wkhtmltopdf

▼魔方 西西 提交于 2019-11-28 21:05:50
I've installed wkhtmltopdf on Centos 5.5. (Since there was library issues, it's been 4 days). It's partly working now. I said partly because, all pdfs which was created by wkhtmltopdf include squares instead of text? What can I do? I've searched google, but I couldn't find anything. Appreciate your help. When I had the black squares issue I was able to solve it without installing X11 by installing the urw-fonts package. I was able to solve this problem using the following resource: http://code.google.com/p/wkhtmltopdf/wiki/static In short, you probably don't need to install the entire x11

How to insert a page break in HTML so wkhtmltopdf parses it?

你离开我真会死。 提交于 2019-11-28 16:39:24
问题 So basically I'm using wkhtmltopdf to convert a dynamic HTML report to PDF. The report has a particular format and I've been asked to clone that format with HTML. The problem I'm facing is that I can't simulate a 100% functional page break in html so wkhtmltopdf can interpret it and send content to another page. I'm trying to avoid page size measurement methods and so. TIA for any help provided. EDIT: So far I'm emulating page break using <br> and it works. I still have to do some testing

How to do page numbering in header/footer htmls with wkhtmltopdf?

随声附和 提交于 2019-11-28 16:20:09
I'm developing an electronic invoicing system, and one of our features is generating PDFs of the invoices, and mailing them. We have multiple templates for invoices, and will create more later, so we decided to use HTML templates, generate HTML document, and then convert it to PDF. But we're facing a problem with wkhtmltopdf, that as far as I know (I've been Googleing for days to find the solution) we cannot simply both use HTML as header/footer, and show page numbers in them. In a bug report (or such) ( http://code.google.com/p/wkhtmltopdf/issues/detail?id=140 ) I read that with JavaScript it

Wkhtmltopdf Characters in single line partially cut between pages

99封情书 提交于 2019-11-28 15:46:56
问题 I am working in a project using ruby on rails(3.1). My requirement is to produce pdf from the html content. So I use pdfkit gem. In some pages, characters in single line partially cut between pages. When I convert html convert to pdf using pdfkit gem version of wkhtmltopdf: wkhtmltopdf -- 0.11.0 rc1 operating system: Linux CentOS 5.5 In the image below showing character partially cut between pages. Please suggest a solution. Example 1 Example 2 回答1: I just ran across this and found something

How to overlay HTML generated PDF on top of existing PDF?

强颜欢笑 提交于 2019-11-28 13:05:36
I'm looking to start with an initial PDF file, one that has graphics and text, and then take some html code which has dynamic values for some user input, generate that as a PDF, hopefully either using the initial PDF as a background, OR somehow running a PHP script afterwards to "merge" both PDF where one acts as a background to another. I have some code that renders an HTML formatted PDF: (using DOMPDF) $initialpdf = file_get_contents('file_html.html'); $initialpdf = str_replace(array( '%replaceText1%', '%replaceText2%' ), array ( $replaceText1, $replaceText2, ), $initialpdf); $fp = fopen(

Generate PDF Behind Authentication Wall

旧城冷巷雨未停 提交于 2019-11-28 09:11:32
I'm trying to generate a PDF using WKHTMLTOPDF that requires me to first log in. There's some on this on the internet already but I can't seem to get mine working. I'm in Terminal - nothing fancy. I've tried (among a whole lot of other stuff): /usr/bin/wkhtmltopdf --post username=myusername --post password=mypassword "URL to Generate" test.pdf /usr/bin/wkhtmltopdf --username myusername --password mypassword "URL to Generate" test.pdf /usr/bin/wkhtmltopdf --cookie-jar my.jar --post username=myusername --post password=mypassword "URL to Generate Cookie For" username and password are both the id

TuesPechkin unable to load DLL 'wkhtmltox.dll'

女生的网名这么多〃 提交于 2019-11-28 07:13:51
问题 I've been using TuesPechkin for some time now and today I went to update the nuget package to the new version 2.0.0+ and noticed that Factory.Create() no longer resolved, so I went to read on the GitHub the changes made and noticed it now expects the path to the dll? IConverter converter = new ThreadSafeConverter( new PdfToolset( new StaticDeployment(DLL_FOLDER_PATH))); For the past few hours I've tried almost all the paths I can think of, "\bin", "\app_data", "\app_start", etc and I can't

how to pass html as a string using wkhtmltopdf?

别等时光非礼了梦想. 提交于 2019-11-28 03:21:01
how to pass html as a string instead of url in wkhtmltopdf using asp.net, c#? STDIn and STDOut have been redirected in this example, so you shouldn't need files at all. public static class Printer { public const string HtmlToPdfExePath = "wkhtmltopdf.exe"; public static bool GeneratePdf(string commandLocation, StreamReader html, Stream pdf, Size pageSize) { Process p; StreamWriter stdin; ProcessStartInfo psi = new ProcessStartInfo(); psi.FileName = Path.Combine(commandLocation, HtmlToPdfExePath); psi.WorkingDirectory = Path.GetDirectoryName(psi.FileName); // run the conversion utility psi

wicked_pdf: Is it possible to have the header only show on the first page & the footer only on the last?

只愿长相守 提交于 2019-11-28 02:17:59
问题 Right now I have :header => {:html => {:template => "layouts/pdf_header.html.erb"}} setting things up. Is there something I can pass in that will only show the header on the first page of the document? Can I do this for the footer as well? It's almost more important here, because I can't really think of any other way to get a footer to dynamically stick to the bottom of the page when it's going to be different lengths and different numbers of pages every time. 回答1: Some quick javascript can