Hello,
I can’t view a pdf from my google drive.
I did the test with “https//docs.google.com/viewer?embedded=true&url= {document}”
where {document} is the web link.
But the result is:
It works with the pdf upload in https//storage.googleapis.com / …
I tried your link in my app, which uses the same google docs wrapper. Seems like it’s seeing it but not rendering it as a pdf. I’ll play around with it and see if I can get it to work. All of my PDF’s are uploaded through the app, so I haven’t ran into this issue before. I’ll get back to you.
var html = "<h1> Hello world, Test New PDF Hello manu </h1>"
+ "<p> The quick brown fox jumped over the lazy dog";
var blob = Utilities.newBlob (html, "text / html", "text.html");
var pdf = blob.getAs ("application / pdf");
var file = DriveApp.createFile (pdf) .setName ("text2.pdf");
But I also did a test with another “real” pdf file, and it’s the same.
If your script is writing the file name to the sheet, hopefully you can write the url in the format above. The file ID is the same, but the rest of the url is structured a little different. Just remember that the file has to be placed into a publicly shared folder, or hopefully you can set the permissions as you are generating the PDF.
For information
Here is the script with the permissions and formatting of the Url.
var html = "<h1> Hello world, Test New PDF Hello manu </h1>"
+ "<p> The quick brown fox jumped over the lazy dog";
var blob = Utilities.newBlob (html, "text / html", "text.html");
var pdf = blob.getAs ("application / pdf");
var file = DriveApp.createFile (pdf) .setName ("text2.pdf");
file.setSharing(DriveApp.Access.ANYONE, DriveApp.Permission.EDIT);
var id=file.getId();
var url = "https://drive.google.com/uc?id=" + id;
Logger.log(url);
Here is how I do it:
Upload the PDFs to a Google Drive Folder
Use the Files Cabinet extension to create a list of the files in that folder
Set the folder share to anyone with link
Find Replace the URL column for /file/d/ and change /view to /preview for the embed to work
Now bring it into Glide. Then I either add the pdf cover or generate an image column
example: Kierkegaard
Good afternoon friend, congratulations on your app, it was really cool! I’m new to Glide, I would like more details so you can do this operation to view the pdf. Did you use script? Can you help me?
So, but in the webview it doesn’t open because it has to be in the paid plan and the image I put an image linked to the link and opened externally and not in the app