pdf-generation

Python configure pdfkit on windows

走远了吗. 提交于 2019-12-09 13:53:08
问题 I started to learn python recently and I want to convert existing html file to pdf file. It is very strange, but pdfkit seems to be the only lib for pdf docs for python. import pdfkit pdfkit.from_file("C:\\Users\\user\Desktop\\table.html", "out.pdf") An error occurs: OSError: No wkhtmltopdf executable found: "b''" How to configure this lib properly on windows to make it work? I can't get it :( 回答1: It looks like you need to install wkhtmltopdf. For windows, the installer can be found at https

Generate table in PDF

风流意气都作罢 提交于 2019-12-09 12:58:10
问题 I want to create a table in a PDF, in which the data are coming from my iPhone app. How can i do that? 回答1: You can achieve the same with Quartz 2D , I found an excellent tutorial for this : How To Create a PDF with Quartz 2D in iOS 5 Tutorial Part 2 回答2: Check out below link there are many other links to do so, it is called table of contexts. pdf file text reading and searching 来源: https://stackoverflow.com/questions/5742616/generate-table-in-pdf

R markdown PDF: Temporarily hide spoiler code for quiz takers

℡╲_俬逩灬. 提交于 2019-12-09 10:08:54
问题 I am using R markdown to create a PDF R course. I want to insert a quiz like the following: --- output: pdf_document --- What is the class of the following R object? 1. `pi` ```{r} class(pi) ``` Which, as expected, creates a PDF with this content: However, I would like the reader to not have such an easy access to the answer. These are the ideas I've had so far to achieve this: Paint the answer and code white, so the reader would have to select the text to see the answer; Include a tooltip

Open Generated pdf file through code directly without saving it onto the disk

喜你入骨 提交于 2019-12-09 07:45:10
问题 I use Sharepoint 2010 and I am developing a web part where on a button click event, a pdf file needs to be generated and opened directly. Should not be saving onto the disk. I tried the below code protected void Button1_OnClick(object sender, EventArgs e) { Document myDoc = new Document(PageSize.A4.Rotate()); try { PdfWriter.GetInstance(myDoc, new FileStream(@"C:\Directory\Test.pdf", FileMode.Create)); myDoc.Open(); myDoc.Add(new Paragraph("Hello World")); } catch (DocumentException ex) {

prawnto displaying tables that don't break when new page

感情迁移 提交于 2019-12-09 06:29:14
问题 I have a variable number of tables with variable number of rows and I want to have them displaying one after the other but if a table doesn't fit on the current page put it on the next then continue on. I have put the table in a transaction so I can roll back then print it if the height will fit on curent page but how do I get the table height? I have this code at the moment pdf.transaction do pdf.table @data, :font_size => 12, :border_style => :grid, :horizontal_padding => 10, :vertical

Generating PDF with Quick Reports behind a Delphi Web Server

*爱你&永不变心* 提交于 2019-12-09 05:38:23
I have a Delphi web server providing some web services*. One of them is supposed to generate and return a PDF report. The PDF creation is done with a QReport that is then exported into a PDF file with the ExportToFilter procedure. The routine works fine when called from within an application, but when called behind a TIdTCPServer, it hangs and never finishes. Debugging it, I got tho the hanging point: (note: I'm home right now and I don't have the source code. I'll try to reproduce quickrpt.pas' source as accurrate as I can remember). procedure TCustomReport.ExportToFilter(TQRDocumentFilter

RTF to PDF in Java

守給你的承諾、 提交于 2019-12-09 03:38:46
问题 We are building an application which partially interacts with other system. We are pulling some data from the other system which is returned as RTF document. But we have to prevent users from editing this file, so we thought about converting it with iText into PDF. Code snippet: // moving the rtf data into input stream to be used in RTF parser ByteArrayInputStream rtfInputStream = new ByteArrayInputStream(rtfStream.toByteArray()); // set headers resp.setHeader("Cache-Control", "no-store");

ASP.NET MVC Generate PDF from byte[]

不想你离开。 提交于 2019-12-09 03:31:14
问题 Before posting this message I looked many posts in SO but few where closed outright saying they need to see FAQ, few gave solutions that use iTextSharp or something else. But none solves my issue. My issue is I have a byte[] and I need to generate a PDF in new child window . We are just using ASP.NET MVC 4 and no iTextSharp or similar. Please let me know if there is already a post that exactly matches this. I am ok to create new Partial Views I have one PDF Icon image in my Partial View. When

PDFsharp on Azure with Custom Fonts

谁说胖子不能爱 提交于 2019-12-09 03:15:31
I am using a webapp on azure to create a PDF using PDFsharp 1.32. As it is a Azure webapp I cannot install fonts. Therefore I am using the following with embedded font options: var globalFontCollection = XPrivateFontCollection.Global; _fontBytes = File.ReadAllBytes(_pathToFont); globalFontCollection.AddFont(_fontBytes, _fontName); However this does not work. There is no error just acts as if the font is not known and falls back to the default. If I install the font it works so I know the rest of the code is correct. Other code shows using AddFont with different parameters however those are not

Render image from servlet in flyingsaucer generated pdf

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-08 23:49:41
问题 I'm using flyingsaucer to render an xhtml document to pdf through a servlet which returns the generated pdf document. The xhtml document features an image which is requested from another servlet. The image servlet checks who is logged in before returning the appropriate image. The code below shows how the image is requested: <img height="140" width="140" src="http://localhost:8080/myapp/servlet/DisplayPic" /> My problem is that the http request for the image is from the pdf renderer and not