![]() ![]() ![]() Here is example of the first two pages - the whole first (left) page and half of the second (right) one contains the information I don't need. Here is the Google Sheet I use for testing it: The app functions under all common operating systems and web browsers. ![]() Supports your system There are no special system requirements to convert webpages to PDF. You dont need to install anything, you only have to enter the URL of a webpage. Sheet.getRange(1,4,links.length,1).setValues(pdfURL) PDF24 makes it as easy and fast as possible for you to convert a web page to PDF. Sheet.getRange(1,3,links.length,1).setValues(fileName) Sheet.getRange(1,2,links.length,1).setValues(errors) Var newFile = pdfFolder.createFile(blob) Var blob = Utilities.newBlob(htmlBody,'text/html').getAs('application/pdf').setName(pdfName) Var htmlBody = response.getContentText() create arrays to track errors, file url, and file name Var pdfFolder = parentFolder.createFolder("PDFS") Var parentFolder = DriveApp.getFolderById(parentFolderId) Var parentFolderId = "1ASMLEDl8rYEQG595TZYtZ9DVUa2u97n_" Here is the code I use (I am sorry if it looks too long - as a newbie in coding I have no idea which part of it must be adjusted): function saveURLAsPDF() ) How can I fix the code to make output files "cleaned out" of excessive information as if they were printed from browser? In contrast, if I just send any webpage to print it goes just as plain text. With the help of Stack Overflow community I got the code I can use (see here) but the problem is that the output PDFs contain extended headers, multiple HTML-elements, etc., which make working with them quite uncomfortable. ![]() I need to convert a long list of URLs (presented as a Google Sheet) into a series of individual PDFs suitable for downloading and future textual analysis. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |