pdf-generation

Programmatically Generate PDF from HTML on iPhone

前提是你 提交于 2019-12-03 09:41:33
I am looking for a way to programmatically (in obj-c) generate a PDF file from a local html file. I am dynamically generating the html from user inputs, I need to create the PDF and send it to the user (via email). I am having difficulty with the PDF generation portion. I have the code to create a PDF using CGPDFContextCreateWithURL but I am struggling with drawing the page using quartz. I have searched extensively on SO as well as the internet to no avail. Any help is much appreciated! To generate a pdf from an HTML, you need to render the html into a web view, and take snapshots of the web

Default paper size and unit for PDF documents on iOS

允我心安 提交于 2019-12-03 09:16:37
问题 For creating PDF documents in iOS, in the official documentation (http://developer.apple.com/library/ios/#documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GeneratingPDF/GeneratingPDF.html#//apple_ref/doc/uid/TP40010156-CH10-SW3), the default size is given as 612x792, which has a ratio of 1.29412. // Create the PDF context using the default page size of 612 x 792. UIGraphicsBeginPDFContextToFile(pdfFileName, CGRectZero, nil); CFRange currentRange = CFRangeMake(0, 0); NSInteger currentPage

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

瘦欲@ 提交于 2019-12-03 08:52:02
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) { Console.Error.WriteLine(ex.Message); } myDoc.Close(); } I also tried the below code which also generates

How to find whether PDF has landscape orientation or portrait

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 08:37:08
Are there tools to determine whether a PDF has landscape orientation or portrait? I have currently looked upon pdfbox and Itext for this but seem that I could not find it. Please tell if they support this. Extracting the PDF pages information using Origami is providing a information the pdf pages have rotation of some degree. Here is what Origami reports: {:Parent=>#<PDF::Reader::Reference:0x872349c @id=8, @gen=0>, :Type=>:Page, :Contents=>#<PDF::Reader::Reference:0x8722f24 @id=4, @gen=0>, :Resources=># <PDF::Reader::Reference:0x870dbd8 @id=2, @gen=0>, :MediaBox=>[0, 0, 612, 792], :Rotate=>270

PHP: Automatically Saving a dynamic PDF to the remote server using DOMPDF

独自空忆成欢 提交于 2019-12-03 08:32:49
I am using the dompdf library to create my table based PDF and I can view it online or I can have it download to the users folder of choice. But what I would like to do is have it save it to the remote server( i dont need it to be save to the users PC), like an automatically upload script that would create the file then upload it to the remote server, so i can then use it within my application later on. is it possible to point the $_FILES["file"] script say so fetch the php page that creates the pdf and it then uploads it from there. You can do one thing like below which i am doing for my

How to handle PDF pagination in PhantomJS

我是研究僧i 提交于 2019-12-03 08:20:16
问题 I am using PhantomJS to create PDFs from html. It works fine, but I can't find out how to work with pagination; I want to create a page for each div in my document, but I can't find anything in the doc. about pagination. If my document is short, it makes only one page, and if it is bigger, it creates one second empty page and my contents are in the first page which becomes very long. Any idea ? (I am using phantomJS-node module for nodeJS) 回答1: PhantomJS takes care of webkit’s css

Can mxGraph export graphs as PDFs?

扶醉桌前 提交于 2019-12-03 08:10:31
I am working on a project that uses mxGraph where I am required to export a high resolution output in PDF for a service process diagram. I've tried recreating the graph using JGraphX, the Java Swing client and exporting that to a PDF, but the result is not close to what the browser displays. There's no PDF export in JavaScript on the client, does mxGraph have any explicit support for PDF generation from JavaScript? I'll explain the case of a client initiated request, where the diagram is displayed on the browser when the request is made. This is the standard case, mxGraph transmits an XML

prawnto displaying tables that don't break when new page

夙愿已清 提交于 2019-12-03 08:08:46
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_padding => 3, :border_width => 2, :position => :left, :row_colors => ["FFFFFF","DDDDDD"] pdf.move_down 20

Embed custom font in a PDF generated from iPad Application

我们两清 提交于 2019-12-03 07:54:22
问题 Overview I am generating a four page PDF document in an iPad application that uses a custom font, Trade Gothic. It is embedding correctly into the application, and looks great. However, part of the app is to email the PDF as a leave behind. This sent file displays all font as a default sans type and on a few systems, I received the error Cannot find or create the font 'RVYPRT+TradeGothicLTStd-Light'. Some characters may not display or print correctly. I am generating the PDF using the UIKit

unable to install wkhtmltopdf with patched qt in ubuntu 16.04

筅森魡賤 提交于 2019-12-03 07:48:54
wkhtmltopdf with patched qt pkg is not available for ubuntu 16.04 .so i am install 14.04 pkg which is install without patched qt but it need it with patched qt. I also tried with static version but it give some compilation error The patched version of wkhtmltopdf is not present in the Ubuntu repository. You can download it from the project website if you want. But they still don't have a .deb file for Xenial Xerus, so you need to download the binary file and install the dependencies ( libxrender1 fontconfig xvfb ) manually. Here is a script that installs the patched version from the project