pdf-generation

How to render a complex UIView into a PDF Context with high resolution?

倾然丶 夕夏残阳落幕 提交于 2019-12-04 09:45:13
问题 There are several questions on SO asking how to render a UIView into a PDF context, but they all use view.layer.renderInContext(pdfContext), which results in a 72 DPI image (and one that looks terrible when printed). What I'm looking for is a technique to somehow get the UIView to render at something like 300 DPI. 回答1: In the end, I was able to take hints from several prior posts and put together a solution. I'm posting this since it took me a long time to get working, and I really hope to

Fonts in pdf documents screwed up when generated with latex (specifically, pdflatex) on mac osx

隐身守侯 提交于 2019-12-04 09:43:08
问题 My colleague suggests that texniscope is somehow to blame and that I should try purging it from my system. I really hope not to have to resort to that! Possible clues: This wasn't an issue till I upgraded to Leopard. When I say the fonts are screwed up, I mean the main text looks like maybe it's the default mac system font, and all math is completely unreadable. Basically all special symbols are completely garbled. I installed latex from here: http://www.tug.org/mactex/. I had already had

Any good PDF export filter that works with Fast Report?

我是研究僧i 提交于 2019-12-04 09:35:57
问题 I recently discovered that the PDFs exported by the Fast Report's PDF export filter aren't displayed correctly in Mac OSX, iOS and Android devices. Fast Report informed that their pdf implementation only support Windows and they can't say when the new implementation that they are working on will be available. I also tried to use the Gnostice export filter, but their demo installer didn't work in Delphi XE and when I contacted them, they took 15 days to send me some attached dcus which also

pdfmake API? Is there a list of styles, fonts, capabilities?

半腔热情 提交于 2019-12-04 09:15:56
问题 I'm using pdfmake. I want to format a document and they have good examples on github and in their playground but I was wondering if they featured all capabilities therein. I get the feeling that their may be additional properties like switching fonts, adding different style elements or underlining - things not expressly shared in the examples. Maybe what you see is what you get and that is all but I went over the github page pretty throughly and did not find a more detailed list of

Generate PDF on the server from Google Maps API?

你说的曾经没有我的故事 提交于 2019-12-04 09:08:45
We have a hosted web app that uses the Google Maps API for various types of geographical reports, using a combination of the javascript API for adding markers and shapes, plus KML overlays for other layers. There's some demand from customers for turning these into nice downloadable & printable PDF maps. I'm not sure where to begin with that. Any ideas? As Mark Storer pointed out, you can use wkhtmltopdf . If you have polylines or other stuff in your map you will likely need wkhtmltopdf to wait for all the pieces to be in place before generating the PDF. This can be done with the latest version

Error running wkhtmltopdf — (error while loading shared libraries)

强颜欢笑 提交于 2019-12-04 08:47:51
问题 When my app runs (or when I run from commandline) the wkhtmltopdf command I get the following error: (showing it from command line) #> wkhtmltopdf wkhtmltopdf: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory I noticed the lib is indeed in the /usr/lib folder but not the /lib folder. Does it matter which one of these it is in? Is there any way to get it to recognize it? #> ls -l /usr/lib/libXrender.so* lrwxrwxrwx 1 root root 19

Phantomjs doesn't render footers with a custom styles

北慕城南 提交于 2019-12-04 08:37:50
问题 I have the following example: var page = require('webpage').create(), system = require('system'); if (system.args.length < 3) { console.log('Usage: printheaderfooter.js URL filename'); phantom.exit(1); } else { var address = system.args[1]; var output = system.args[2]; page.viewportSize = { width: 600, height: 600 }; page.paperSize = { format: 'A4', margin: "1cm" footer: { height: "1cm", contents: phantom.callback(function(pageNum, numPages) { if (pageNum == numPages) { return ""; } return "

How to merge two landscape pdf pages using pyPdf

落花浮王杯 提交于 2019-12-04 08:22:55
I'm having trouble merging two PDF files with pyPdf. When I run the following code the the watermark (page1) looks fine, but the page2 has been rotated 90 degrees clockwise. Any ideas what's going on? from pyPdf import PdfFileWriter, PdfFileReader # PDF1: A4 Landscape page created in photoshop using PdfCreator, input1 = PdfFileReader(file("base.pdf", "rb")) page1 = input1.getPage(0) # PDF2: A4 Landscape page, text only, created using Pisa (www.xhtml2pdf.com) input2 = PdfFileReader(file("text.pdf", "rb")) page2 = input2.getPage(0) # Merge page1.mergePage(page2) # Output output = PdfFileWriter()

Active Admin view to PDF

Deadly 提交于 2019-12-04 08:05:35
I'm starting to develop in Ruby on Rails recently, therefore I consider myself beginner. I'm testing the Active Admin gem ( http://activeadmin.info/ ) and I found a problem when export a view to PDF. In the official documentation says how to customize the download links ( http://activeadmin.info/docs/3-index-pages.html , it is at the end of the document) but does not work for me. When I put the following line of code: Mymodel ActiveAdmin.register do index: download_links => [: pdf] end The result is a link to localhost:3000/admin/mymodel.pdf and the following error displays: "Failed to load

How to embed external pdf/txt file into another using XSL-FO?

拜拜、爱过 提交于 2019-12-04 07:44:29
Is it possible to embed an external PDF or TEXT document into a master PDF by using XSL-FO/XSLT? I have xslt stylesheet to produce PDF documents. But, the input XML contains inlined TEXT or Base64 encoded PDF documents. So what I do in my HTML version of my stylesheet I extract the TEXT or PDF and dump it on disk. Then in the xslt I have this: <xsl:when test='(n1:text/@mediaType="application/pdf") or (n1:text/@representation="B64")'> <IFRAME name='documentFrame' id='documentFrame' WIDTH='100%' HEIGHT='65%' src='{$DOC_URI}'/> </xsl:when> For HTML conversion it is working perfectly. Is it