Convert all sheets to PDF with Google Apps Script

I’ve tweaked @Mogsdad code slightly to print the entire spreadsheet as one PDF. The key is tweaking the export parameter. Basically replace ‘&gid=’ + sheet.getSheetId() //the sheet’s Id with (optSheetId ? (‘&gid=’ + sheet.getSheetId()) : (‘&id=’ + ss.getId())) // Print either the entire Spreadsheet or the specified sheet if optSheetId is provided So the code … Read more

Convert PDF to image with high resolution

It appears that the following works: convert \ -verbose \ -density 150 \ -trim \ test.pdf \ -quality 100 \ -flatten \ -sharpen 0x1.0 \ 24-18.jpg It results in the left image. Compare this to the result of my original command (the image on the right):    (To really see and appreciate the differences between … Read more

How to download single sheet as PDF to my local device directly (not export to Google Drive)?

You want to download a specific sheet in the active Spreadsheet as a PDF file. If my understanding is correct, how about this sample script? This sample script supposes the following points. Script is the container-bound script of Spreadsheet. Sheet you want to download is in the active Spreadsheet. When the script is run, a … Read more

iTextSharp-generated PDFs now cause Save dialog in Adobe Reader X

The problem is this line: Response.OutputStream.Write(MS.GetBuffer(), 0, MS.GetBuffer().Length) The GetBuffer method returns the entire internal buffer which is larger that the actual content. The bad PDF has about 10kb of garbage content at the end (bytes of zero), the good PDF has only a few garbage bytes. Use the ToArray() method of the memory stream … Read more

Unable to copy exact hindi content from pdf

This issue is similar to the one discussed in this answer, and the appearance of the sample document there does also remind of the document here: In a nutshell Your document itself provides the information that e.g. the glyphs “निर्वाचक” in the head line represent the text “ननरररचक”. You should ask the source of your … Read more

Angular 2 download PDF from API and Display it in View

In fact, this feature isn’t implemented yet in the HTTP support. As a workaround, you need to extend the BrowserXhr class of Angular2 as described below to set the responseType to blob on the underlying xhr object: import {Injectable} from ‘angular2/core’; import {BrowserXhr} from ‘angular2/http’; @Injectable() export class CustomBrowserXhr extends BrowserXhr { constructor() {} build(): … Read more