3

I'm writing a Google Chrome Extension, and I need a way of saving the contents of the current page, whether it's an HTML page or a PDF page.

For HTML, I can use chrome.pageCapture.saveAsMHTML, however, this does not work if the current page is a PDF document. I've been searching for a way to dump the PDF from Chrome's PDFViewer, but I've found absolutely no information on it.

The one requirement I have is that I can't issue a second request, as the PDF is the response from a form submission, and a second request would re-submit the form causing duplicate data. This system is out of my control, so I can't change the behavior.

Brandon
  • 16,382
  • 12
  • 55
  • 88
  • Sorry for my eng. I don't understand, you want just download pdf document or detect pdf page? – UserName Aug 01 '16 at 15:27
  • I'd like to be able to programatically save the PDF to a specific location, without issuing a second HTTP request. – Brandon Aug 01 '16 at 15:30
  • Possible duplicate of [Chrome extension - saving PDF file](http://stackoverflow.com/questions/29114794/chrome-extension-saving-pdf-file) – Haibara Ai Aug 02 '16 at 01:05
  • The approach in the "duplicate" answer requires a second request, which I've said won't work for my approach – Brandon Aug 02 '16 at 11:31

0 Answers0