Google web app to pdf

Visto 167 veces
Saltar al primer mensaje no leído

Dora Samy

no leída,
10 sept 2021, 17:28:1410/9/21
a Google Apps Script Community

Hi,
I have gratuity template to be filled by staff as web app.
Is there option to print automatically from the web app to  pdf and save it in gdrive.
Instead of  copying the template to sheet and resizing the rows and export to pdf??

Clark Lind

no leída,
11 sept 2021, 10:28:2511/9/21
a Google Apps Script Community
There isn't a simple/easy solution, no (that I am aware of).

Without incorporating an external library like PDF-lib.js which really runs in the browser on the front-end, you are asking how it can be done on the Google servers on the back-end. Correct? 
Since you are limited to what Apps scripts can do, the process involves storing the inputted data somewhere (usually a sheet) in a file in Drive. Then that file is converted to PDF. 

So you could build a simple template as a G-Doc, then on form submission, make a copy of the Doc-template, replace the text, and convert it to pdf and move it to the desired drive folder.

Whether you use a sheet or doc or something else as a template, you will need to use something to "hold" the data in the format you want in order to convert and save it as PDF.

Dora Samy

no leída,
11 sept 2021, 13:47:5211/9/21
a Google Apps Script Community
Hi,
At present i use google sheet for other templates. But what i faced issues in previous one was when items are added to the sheets ,
ie adding or deleting of rows -
the formatting like- merging and background color took time , and it went to pdf function  without fully formatting. This was averted using utilities.sleep.
But another hurdle was in the template i need, there will be a signature at the end and data will be added as item after the headers,
so if it goes to second page, the sign must be at the bottom along with the total before that. How to set template like that for multiple pdf, if it goes more than one page.
Thats where i am struck at. That is the reason i was seeing some alternatives.

Alan Wells

no leída,
11 sept 2021, 18:11:2711/9/21
a Google Apps Script Community
It's possible to convert HTML to a PDF.

Dora Samy

no leída,
12 sept 2021, 14:45:0612/9/21
a Google Apps Script Community
Hi,
Is it possible to set custom headers and footers while converting to pdf??

Andrew Roberts

no leída,
12 sept 2021, 15:21:0612/9/21
a google-apps-sc...@googlegroups.com
Might be something here.

--
You received this message because you are subscribed to the Google Groups "Google Apps Script Community" group.
To unsubscribe from this group and stop receiving emails from it, send an email to google-apps-script-c...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-apps-script-community/2eb42da5-d40d-4322-9ebe-6eed9ffa7bb0n%40googlegroups.com.

Dora Samy

no leída,
12 sept 2021, 16:32:5912/9/21
a Google Apps Script Community
Hi,
I have set it to true and added both fzc and fzr to true   and added to the existing code. Still it is not repeating headers.
I had also tried your code, for my sheet removing the original code. Also it is not repeating the rows.
I have a row 15 in my sheet which has name of the staff.. and 4 columns which i want it to repeat in the multiple page as headers and signatures for approval in footers which is in 50 th row.
This is what iam trying to do without going to doc.. from sheet itself or from webapp html template??

Dora Samy

no leída,
15 sept 2021, 16:18:0415/9/21
a Google Apps Script Community
Hi alan,
THanks for the labnol link,I am trying to directly convert the webapp form html content to pdf.. not the html template. I checked your link. I also saw the chrome solution.
But user can also use different os.

Dora Samy

no leída,
15 sept 2021, 16:19:1215/9/21
a Google Apps Script Community
Hi Robert,
I added the parameter for repeat row and column, but i am not successful in that. i am not getting whether i am going wrong somewhere or is that parameter setting to true
alone is not enough?
Responder a todos
Responder al autor
Reenviar
0 mensajes nuevos