pdf-generation

secure pdf : locked/uneditable to prevent changes after generating from iOS device

风流意气都作罢 提交于 2019-12-03 20:18:01
I am using UIKit Framework to generate pdf in iOS device. I am wondering if we can lock (provide security) to the generated pdf so that after emailing or downloading it , one can not edit/modify using any pdf editable tool. Yes - this is possible. If you start the creation of a PDF with UIGraphicsBeginPDFContextToFile you can then send a dictionary to it with options to specify what kind of encryption/locking you want. Here is the documentation for it: http://developer.apple.com/library/ios/#documentation/uikit/reference/UIKitFunctionReference/Reference/reference.html And here is an example

How to save output from ggforce::facet_grid_paginate in only one pdf?

拈花ヽ惹草 提交于 2019-12-03 20:01:44
问题 I'm using the ggforce package to generate facetted plots over several pages: library(ggforce) for(i in 1:6){ ggplot(diamonds) + geom_point(aes(carat, price), alpha = 0.1) + facet_wrap_paginate(~cut:clarity, ncol = 2, nrow = 2, page = i) ggsave(paste0("~/diamonds_", i, ".pdf")) } which is generating the expected 6 PDF files: What is the easiest way have the output in one single pdf with 6 pages? I understand this can be done with the reports and pdftools packages, but I'm wondering if there's

Grails rendering plugin css issue

隐身守侯 提交于 2019-12-03 18:10:26
问题 I've just installed grails rendering plugin and would like to use it for generating PDF files. I've created simple template, but it is exported without any css styles. If I simply render template from grails, then page appears with all styles in my web browser. So, my question is - how to correctly include CSS file during PDF generation process? My template: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html> <head> <link rel=

Saving flot chart to image or pdf

ぐ巨炮叔叔 提交于 2019-12-03 17:22:40
I'm trying to save a flot chart to an image and eventually to a pdf, but can't quite figure out how. Online I see that I can do canvas.toDataURL("image/png") But the trouble is how do I get the canvas in the first place, the examples say to use document.getElementById("canvas"); but for my code I'm using a div with id="placeholder" (per all the flot examples) and there's nothing labeled with a canvas tag in my html, and this doesn't seem to work. My javascript for flot looks like $.plot($("#placeholder"), [ d1, d2, d3 ], { series: { lines: { show:false }, bars: { show: true, barWidth: 0.6,

javascript library to convert web page to pdf [closed]

做~自己de王妃 提交于 2019-12-03 17:20:09
问题 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 last year . Is there any client-side library that can convert a web page to a PDF document? I have used jspdf but the generated pdf does not retain the formatted html (like tags should be boldface in the PDF). 回答1: Very simple if your page is not having any sensitive data Just Do this: <a href="http://pdfcrowd.com/url_to_pdf/

table width not set in iTextSharp when converting html to PDF

帅比萌擦擦* 提交于 2019-12-03 17:09:07
I am trying to convert an html to pdf but the problem i face is that the html table tags width is not getting set correctly.. This is my html <table cellpadding='4' cellspacing='4' border='0' width='100%' style='width:100%'> <tr style='background-color:#000000'> <td colspan='2' align='center' valign='middle' width='100%'> <font face='Calibri' size='6' color='#FFFFFF'>Retail Natural Gas Deal Sheet</font> </td> </tr> <tr> <td colspan='2' width='100%'> </td> </tr> <tr> <td width='90%' style='width:90%'> <table cellpadding='0' cellspacing='0' border='0' width='100%'> <tr> <td width='42%'> <font

How to add an image to asciidoc book cover page?

空扰寡人 提交于 2019-12-03 17:02:52
问题 I would like to create a pdf book using asciidoc. The title page should include the title, subtitle and an image. So far I could not find any documentation on how to achive this. Intuivly I would do something like My book title ============= :author: myself :toc: image:images/titelimage.png[width=400] but this just adds image:images/titelimage.png[width=400] as a subtitle. What I would like to have is something like My book title <titleimage> subtitle Is there a way to do this in ascciidoc?

iTextSharp Efficient Batch Pdf Generation From a 1 Page Template

梦想的初衷 提交于 2019-12-03 16:25:59
I am generating a multiple page PDF using ITextSharp, each page having the sames template. The problem is that the PDF grows in Phisical Size by the size of the template. I HAVE to use ACROFIELDS . How can I reduce the final file size ? Here is a code snippet of the pdf handler: public void ProcessRequest(HttpContext context) { Context = context; Response = context.Response; Request = context.Request; try { LoadDataInternal(); } catch (System.Threading.ThreadAbortException) { // no-op } catch (Exception ex) { Logger.LogError(ex); Response.Write("Error"); Response.End(); } Response.BufferOutput

iText 7: Paragraph height as it would be rendered

心已入冬 提交于 2019-12-03 16:25:40
I can set the width of a new paragraph as follows, which results in a certain height: Paragraph p = new Paragraph("some longer text some longer text some longer text"); p.setWidth(100); System.out.println("height " + p.getHeight()); document.add(p); Of course p.getHeight() is null , since the rendered height is calculated during rendering the PDF file. But I need the height before the final rendering. How can I get it most efficiently? To get the effective width of the paragraph as if it was drawn on a page already, you need to create renderer tree from model element tree, and then layout the

iOS: How to set font when drawing text in pdf generation?

ε祈祈猫儿з 提交于 2019-12-03 16:13:37
I'am generating a pdf in ios app, using drawpdf function,while calling the drawtext function in the nsobject class it draws the text clearly according to the frame and string which I specified. My code is +(void)drawText:(NSString*)textToDraw inFrame:(CGRect)frameRect { CFStringRef stringRef = (__bridge CFStringRef)textToDraw; // Prepare the text using a Core Text Framesetter CFAttributedStringRef currentText = CFAttributedStringCreate(NULL, stringRef, NULL); CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(currentText); CGMutablePathRef framePath = CGPathCreateMutable();