pdf-manipulation

Email filled PDF with PHP or PHPMailer

倖福魔咒の 提交于 2019-12-11 12:38:31
问题 My company is currently trying to streamline our process for submitting forms. I have read that what we are trying to do can be done with PHP or PHPMailer but I seem to have hit a roadblock. What we are trying to do is open a fillable PDF in browser, complete it, and then click a button at the bottom to email it to a designated recipient. I currently have a PHP script that allows me to email the blank document using PHPMailer and our server email service. I have tried using the

PDF document manipulation

拈花ヽ惹草 提交于 2019-12-11 12:19:41
问题 I have several PDFs with the following properties: Each PDF contains a variable number of "documents" with differing number of pages. Each page in a "document" has text such as "Page 3 of 26". I want to be able to automatically identify the first and last page of each "document" within a PDF (Note: this is not the same as the first and last page of a PDF as each PDF may contain several "documents") and extract these into a new PDF for later printing and archival. I'm not sure what tools I can

How to concatenate multiple pdf as one, each input pdf starting on an even page?

不问归期 提交于 2019-12-10 15:48:43
问题 DUPLICATE OF How can I merge PDF files (or PS if not possible) such that every file will begin in a odd page? I have a serie of documents, each one with an unpredictable number of pages. Say : a.pdf (1 page : A1) b.pdf (3 pages : B1, B2, B3) c.pdf (4 pages : C1, C2, C3, C4) I want to merge these input files into one out.pdf, that I'll print double-side. Every first page of the input files must be on a front (right) page. This means the expected result would be |A1 --|B1 B2|B3 --|C1 C2|C3 C4|

Change metadata of pdf file with pypdf2

匆匆过客 提交于 2019-12-04 16:07:11
I want to add a metadata key-value pair to the metadata of a pdf file. I found a several years old answer, but I think this is way to complicated. I guess there is an easier way today: https://stackoverflow.com/a/3257340/633961 I am not married with pypdf2, if there is an easier way, then I go this way? Tarun Lalwani You can do that using pdfrw pip install pdfrw Then run from pdfrw import PdfReader, PdfWriter trailer = PdfReader("myfile.pdf") trailer.Info.WhoAmI = "Tarun Lalwani" PdfWriter("edited.pdf", trailer=trailer).write() And then check the PDF Custom Properties Cyril N. I was surprised

Splitting single page into two pages with ghostscript

蓝咒 提交于 2019-11-30 23:58:30
I have a pdf with something like presentations slides and multiple slides per page. How can I use ghostscript to split the file so that there is one slide per page? A long time ago I wrote some code for someone on comp.lang.postscript to do this, again it was for PowerPoint slides. This PostScript code assumes that all the 'subpages' (ie slides) are the same size and location on the PDF page and that all the PDF pages are the same size. Save the following as a file called pdf_slice.ps and follow the usage as described in the comments. %!PS % Copyright (C) 2011 Artifex Software, Inc. All rights

Merge Multiple PDF's into one PDF

落花浮王杯 提交于 2019-11-30 16:12:39
I am having some issues with my code. I am trying to loop through a Drive folder that contains many PDFs and then merge these into one file. When I use my code it just creates a PDF for the last PDF in the Drive folder and not merge them all together as expected. function MergeFiles(){ var folder = DocsList.getFolderById('myFolderID'); var files = folder.getFiles(); var blobs = []; for( var i in files ) blobs.push(files[i].getBlob().getBytes()); Logger.log(blobs.push(files[i].getBlob().getBytes())); var myPDF = Utilities.newBlob(blobs.pop(), "application/pdf", "newPDF.pdf"); folder.createFile

How to convert a PDF to grayscale from command line avoiding to be rasterized?

纵饮孤独 提交于 2019-11-28 23:19:58
I'm trying to convert to grayscale this PDF: https://dl.dropboxusercontent.com/u/10351891/page-27.pdf Ghostscript (v 9.10) with pdfwrite Device fails with a "Unable to convert color space to Gray, reverting strategy to LeaveColorUnchanged." message. I'm able to convert it through an intermediary ps file (using gs, pdftops (v 0.24.3) or pdf2ps) but this convertion rasterize the whole PDF. I tryed a lot of other things: normalize the PDF using qpdf (v 5.0.1) or pdftk (v 1.44), transform it to a svg file and back to a PDF via Inkscape (v 0.48.4)... nothing seems to work. The only one solution I

Parsing a PDF with no /Root object using PDFMiner

﹥>﹥吖頭↗ 提交于 2019-11-28 10:01:04
I'm trying to extract text from a large number of PDFs using PDFMiner python bindings. The module I wrote works for many PDFs, but I get this somewhat cryptic error for a subset of PDFs: ipython stack trace: /usr/lib/python2.7/dist-packages/pdfminer/pdfparser.pyc in set_parser(self, parser) 331 break 332 else: --> 333 raise PDFSyntaxError('No /Root object! - Is this really a PDF?') 334 if self.catalog.get('Type') is not LITERAL_CATALOG: 335 if STRICT: PDFSyntaxError: No /Root object! - Is this really a PDF? Of course, I immediately checked to see whether or not these PDFs were corrupted, but

Parsing a PDF with no /Root object using PDFMiner

北城余情 提交于 2019-11-27 18:10:44
问题 I'm trying to extract text from a large number of PDFs using PDFMiner python bindings. The module I wrote works for many PDFs, but I get this somewhat cryptic error for a subset of PDFs: ipython stack trace: /usr/lib/python2.7/dist-packages/pdfminer/pdfparser.pyc in set_parser(self, parser) 331 break 332 else: --> 333 raise PDFSyntaxError('No /Root object! - Is this really a PDF?') 334 if self.catalog.get('Type') is not LITERAL_CATALOG: 335 if STRICT: PDFSyntaxError: No /Root object! - Is

How to convert a PDF to grayscale from command line avoiding to be rasterized?

我怕爱的太早我们不能终老 提交于 2019-11-27 14:41:09
问题 I'm trying to convert to grayscale this PDF: https://dl.dropboxusercontent.com/u/10351891/page-27.pdf Ghostscript (v 9.10) with pdfwrite Device fails with a "Unable to convert color space to Gray, reverting strategy to LeaveColorUnchanged." message. I'm able to convert it through an intermediary ps file (using gs, pdftops (v 0.24.3) or pdf2ps) but this convertion rasterize the whole PDF. I tryed a lot of other things: normalize the PDF using qpdf (v 5.0.1) or pdftk (v 1.44), transform it to a