0

I managed to get a PDF in a content type and to show the full PDF. I do this with the PDF module in drupal 7. But I want't the height of 1 page (A4 always) or just the full height of the document.

How can I manage this? 100%, auto doesn't work. I can only give a certain amount of pixels. But when it's resized, it's not perfect, the frame is higher then the document.

When I try to use the option PDF: Continuos scroll, it breaks. That should also be a solution for me, just the height of the document. But I have the following errors:

Uncaught (in promise) TypeError: Cannot read property 'getDirection' of undefined at webViewerLocalized (viewer.js?opdors:7109) viewer.js?opdors:4958 Uncaught (in promise) TypeError: Cannot read property 'firstElementChild' of null at PDFViewer (viewer.js?opdors:4958) at viewer.js?opdors:5790 at Promise () at Object._initializeViewerComponents (viewer.js?opdors:5778) at viewer.js?opdors:5692 /sbsdebrug/sites/all/libraries/pdf.js/build/pdf.worker.js:50046 The provided value 'moz-chunked-arraybuffer' is not a valid enum value of type XMLHttpRequestResponseType. supportsMozChunkedClosure @ /sbsdebrug/sites/all/libraries/pdf.js/build/pdf.worker.js:50046 pdf.js:28 Uncaught (in promise) ReferenceError: getOutputScale is not defined at renderPage (pdf.js:28) pdf.js:28 Uncaught (in promise) ReferenceError: getOutputScale is not defined at renderPage (pdf.js:28) pdf.js:28 Uncaught (in promise) ReferenceError: getOutputScale is not defined at renderPage (pdf.js:28) pdf.js:28 Uncaught (in promise) ReferenceError: getOutputScale is not defined at renderPage (pdf.js:28)

0

I did something similar with print module , it also may be posible with PDF module. Override print--pdf.tpl.php file to fit your needs, copy print.tlp.php file from print-module directory (or look for a similar file in pdf module), paste it in sites/all/themes/your-sub-theme/templates folder. in line 100 is print $content, there add a css class "myclass" with higth=100%; done!.

  • I will try this.. – Finduilas May 15 '17 at 8:04
  • This doesn't work.. It doesn't work with template files.. – Finduilas May 15 '17 at 14:44
0

The PDF module isn't compatible with pdf.js 1.8. I went down in versions, and from 1.3 and below. This works. There are still some errors in console, but that's fine for me (I didn't tried lower then version 1.1).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.