Update an existing PDF - pdf

I have an existing PDF template, and I want to add some text over the top of it in a specific location on a specific page. For example, an invoice template or a scanned document.
How would I go about this? I'm using Sheets if that narrows my options.
There is a lot of documentation on how to create PDFs from documents, but nothing that will take a particular PDF and put text over it.

A bit of blue sky thinking from my side. What if you were to do the following?
Manually:
Export the PDF as an image
Resize a Google slide to be the same shape as the image
Add the image to the google slide as a background image
In Code:
Make a copy of the google slide as needed
Add your Google sheets data to the slide positioned as needed on the slide
Export the Google slide as a pdf
I mention google slides, because Google docs to not have allow background images.
Another possibility with using Google docs is to build a document that looks like your invoice, then add to it tags. In your code search for the tags and replace them with data from your sheet. Even you could use a mail merge addon to do this if you didn't fancy writing any code.

In your Google Drive right-click on your PDF;
Open With > Connect More Apps > Search docusign > Left-click blue connect button and this should take you to Docusign.
Your PDF will then open with Docusign where you can manually add a signature or text to specific places.
Alternatively... You can use App Script.
Example,
Constructing a document using HTML and replacing the specific value with a variable which is collect from a Sheet or particular location. Writing the function to do this will allow you to interpret the HTML and replace the variable with the text or possibly an image. Then it would create this as a PDF.
There are many alternative ways to do this.
Here is one example on github;
Convert Google Doc to PDF using App Script

Related

Fetch a certain page of a pdf as an image from google drive

I have some 10,000 pages of hand-written scanned documents in google drive in somewhere around 70 pdf documents.
I am making a spreadsheet index of these, with one row for each page where I make notes of what is on each page, by actually viewing those pages, reading it, and every fully typing it if required.
I need a link, which I can put in the spreadsheet, which when clicked opens up a certain page of the pdf as an image only, and not the entire pdf, the pdf is in google drive. Is there something like this possible in Google Drive? Or should I manually download all pdf, split it into images, and then re-upload and use that?
(example - java -jar pdfbox-app.jar PDFToImage -format jpg -quality 0.75 pdffile.pdf ; and then upload all this)
I have a feeling it must be possible because when we open the pdf in browser, it loads pdf pages one by one, it takes time but it opens it in some custom image+text format, so it must be exported. Also I know there is one image version for each google slide and link is stable, so there might be something for pdf also I was thinking.
There isn’t a parameter or feature to link a pdf page in Google Drive file viewer.
Indeed as mentioned, you can link to a specific slide in Google Slides, however Google file types do have additional features.
That’s not the case for PDFs for example. A workaround I can think of would be to create a comment for each page and each comment will have its own id.
After creating the comment, you can click on the three vertical dots icon and click on Link to this comment.
Alternatively, you can send feedback to Google (On file viewer page, click on three vertical dots icon and then Send feedback to Google) making sure to describe the proposed feature.

What is the query parameter used by Google for setting custom headers in the exported pdf?

Using Google Sheets and working on a script to make exporting (downloading) a PDF copy of a single sheet much easier. The end goal is to emulate the Download as... PDF, but click of a button and it's done, without having to go to the menu. Also uses a custom file name (which includes the date and time).
The question...
When exporting a sheet using a script, is there a way to customize the content of the headers? I know when doing it manually, I can customize what appears in the headers and footers, but what about a script to change the top (or bottom) left/center/right areas when exporting a PDF via script? I know I can optionally enable a title (printtitle=true) or sheet name (sheetnames=true), but I can't find anything to permit me to customize what appears.
What I would like is to have a custom name/string for the top left and top center, then the date and time in the top right.

Extract PDF coordinates using mouse click

I want to extract the coordinates of a PDF document with the help of a mouse click. I have gone through some posts but since I'm new to this, I'm not being able to understand it properly. Also, can this be done if I render the PDF file in a web page?
You can add javascript to a pdf document. Although you only get access to a limited subset of the language.
If you only need the coordinates once (for instance when doing layout of the document), you can simply open it with adobe and activate the rulers/grid option to see where your mousepointer is currently located.

Google Script for PDF image/screenshot import into Google Doc

I'm trying to write a script that takes images from a PDF file and puts them into a Google Doc Template. The PDF has a bunch of images in it, one image per page. What I want to do is grab the images one at a time (or take a screenshot of the entire page) and paste it into a new document. How can I access a single image at a time to import it into the google doc?
Thanks.
There is probably no way to play directly with a pdf file but you should consider to first convert these pdf to google docs and, in a second time, use the document class that can retrieve images inside the doc quite easily...

is it possible to hyperlink to external pdf selection?

I'd like to create hyperlink references to a text selection or offset in an external PDF document, as if there were an anchor defined. E.g., http://lib.extern.org/doc1.pdf?page=3&paragraph=4 so that when the user follows the link in their browser, the PDF document opens positioned at the offset specified. I'm looking for any granularity, e.g. page, paragraph, line, word, character or even pixel em or inch offset would be acceptable. If a range for a selection could be specified that would be ideal, the purpose being to highlight and link directly to quotes in external PDF docs (to which the app has read-only access.) Seems so basic, but I haven't found a solution. Ideas?
It appears it works for page numbers
EDIT: And also check this (it should open on page 8)
There are no standards for commandline parameters for the plugins.
But if you can render a fresh PDF each time (make a copy and put in a new object via some PDF manipulation API), you can include an OpenAction that jumps to the page in question. You can even set more viewer parameters (or do some other personalization, watermarks, whatever...).