pdf

R pdf set margin

淺唱寂寞╮ 提交于 2021-02-07 13:16:42
问题 I am trying to set the figure margin for a pdf generated with R. Using mar, I can reduce the plot margins. However the resulted plot is still a square in the middle of the page instead of using all the space. How can I change that? pdf(file = "test.pdf", paper="a4r") par(mar=c(0,0,0,0)+0.1) plot(1:10,1:10) dev.off() Thank you! 回答1: Within pdf(), change the width and height arguments (https://stat.ethz.ch/R-manual/R-devel/library/grDevices/html/pdf.html). The default values are 7 and 7, which

Printing a file and configure printer settings

匆匆过客 提交于 2021-02-07 12:53:19
问题 I'm trying to code a printer automation using Python on Windows, but can't get it done. I'm not really understanding the topic and i'm a little surprised - a "simple" way to get this done doesn't seem to exist..? There are so many APIs that allow to access common things in a nice and easy way, but printing seems to be something "special"..? Here is what i have and what i want to do: There is a PDF file. The PDF already exists, i do not want to create PDFs or any other filetype. I like to

How do I output HTML form data to PDF?

你说的曾经没有我的故事 提交于 2021-02-07 12:45:21
问题 I need to collect data from a visitor in an HTML form and then have them print a document with the appropriate fields pre-populated. They'll need to have a couple of signatures on the document, so it has to be printed. The paper form already exists, so one idea was to scan it in, with nothing filled out, as an image. I would then have the HTML form data print out using CSS for positioning and using the blank scanned form as a background image. A better option, I would think, would be to

Adding fonts to Apache Pdfbox?

只愿长相守 提交于 2021-02-07 11:57:37
问题 Is there a way to add additional font styles into Apache Pdfbox? We're currently trying to work around printing PDFs in our system (currently being done with PDF-Renderer.) I have been looking at various alternatives (pdfbox, jpedal, jPDFPrint) Our hope is for a free GPL compatible library to use, and as such we're leaning towards pdfbox. I have been able to write some sample code to print out the pdf which 'works'. See below: PDDocument doc; try { doc = PDDocument.load("test.pdf"); doc.print

Select one element from a list using python following the normal distribution

醉酒当歌 提交于 2021-02-07 10:30:45
问题 I would like to select one element from a list using python following the normal distribution. I have a list, e.g., alist = ['an', 'am', 'apple', 'cool', 'why'] For example, according to the probability density function (PDF) of normal distribution, the 3rd element in the given list should have the largest probability to be chosen.Any suggestions? 回答1: from random import normalvariate def normal_choice(lst, mean=None, stddev=None): if mean is None: # if mean is not specified, use center of

How to create a link that download a file in Symfony

倾然丶 夕夏残阳落幕 提交于 2021-02-07 08:43:49
问题 I did some research and I found this post: How to create a link to download generated documents in symfony2? I tried the solution, but it show my pdf in the browser, but what I want is that when someone click the link, it directly download the file. Is ther a way to do that with Symfony? Kévin Duguay 回答1: Set up an action. This uses annotation for the route. YOu can of course use yml or xml or whatever you are currently using /** * @Route("/download", name="download_file") **/ public function

How to create a link that download a file in Symfony

帅比萌擦擦* 提交于 2021-02-07 08:43:24
问题 I did some research and I found this post: How to create a link to download generated documents in symfony2? I tried the solution, but it show my pdf in the browser, but what I want is that when someone click the link, it directly download the file. Is ther a way to do that with Symfony? Kévin Duguay 回答1: Set up an action. This uses annotation for the route. YOu can of course use yml or xml or whatever you are currently using /** * @Route("/download", name="download_file") **/ public function

How to remove duplicate objects in PDF using ghostscript?

霸气de小男生 提交于 2021-02-07 08:40:55
问题 Using command-line ghostscript, is it possible to remove duplicate embedded objects (images) in the PDF and replace them with a single instance? I have a 200+ pages PDF with a background image and some smaller logos on each page. The file is very large, because the very same background image and logo binaries are embedded in each individual page, instead of being embedded once and then referenced on each page. I am not the creator of the PDF so I can not solve the problem at it's source. (I

How to remove duplicate objects in PDF using ghostscript?

孤者浪人 提交于 2021-02-07 08:39:55
问题 Using command-line ghostscript, is it possible to remove duplicate embedded objects (images) in the PDF and replace them with a single instance? I have a 200+ pages PDF with a background image and some smaller logos on each page. The file is very large, because the very same background image and logo binaries are embedded in each individual page, instead of being embedded once and then referenced on each page. I am not the creator of the PDF so I can not solve the problem at it's source. (I

Can iTextSharp rasterize/export to JPEG or other image format?

血红的双手。 提交于 2021-02-07 07:17:34
问题 I need to be able to export PDF's that I am creating to JPEG, so that users can have a screenshot/thumbnail of the end product, which is faster than opening the whole PDF. I am running this on an ASP.NET website running in Medium Trust in the Rackspace Mosso Cloud . I have yet to find a library that will either work in Medium trust, or in the case of ABC PDF, which works great locally, wont load in Mosso. Maybe Mosso has a custom trust level? I know that iTextSharp works on Mosso, but I haven