Browse Source
Fixes #6106 To avoid future regressions, two new unit tests were added: 1. A new PDF based on the report from #6106, which contains an OpenAction of type JavaScript and a string "this.print({...}". 2. An existing PDF from https://bugzil.la/1001080 (from #4698). Although it does not matter, since we don't execute the JavaScript code, I have also changed "print(true)" to "print({})" since the print method takes an object (not a boolean). See "Printing PDF documents", page 62: http://adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/js_developer_guide.pdf
6 changed files with 124 additions and 24 deletions
Binary file not shown.
@ -0,0 +1,70 @@
@@ -0,0 +1,70 @@
|
||||
%PDF-1.4 |
||||
% To manually verify that PDF.js works as expected, open this PDF file with |
||||
% PDF.js and check whether the browser attempts to print the PDF. |
||||
1 0 obj |
||||
<< |
||||
/Type /Catalog |
||||
/Pages 2 0 R |
||||
/OpenAction 3 0 R |
||||
>> |
||||
endobj |
||||
2 0 obj |
||||
<< |
||||
/Type /Pages |
||||
/Count 1 |
||||
/Kids [4 0 R] |
||||
>> |
||||
endobj |
||||
3 0 obj |
||||
<< |
||||
/Type /Action |
||||
/S /JavaScript |
||||
% This is a verbatim copy from a PDF generated by Google Drive (20 July 2015) |
||||
/JS (this.print\({bUI:true,bSilent:false,bShrinkToFit:true}\);) |
||||
>> |
||||
endobj |
||||
4 0 obj |
||||
<< |
||||
/Parent 2 0 R |
||||
/Contents 6 0 R |
||||
/Type /Page |
||||
/Resources 5 0 R |
||||
/MediaBox [0 0 400 200] |
||||
>> |
||||
endobj |
||||
5 0 obj |
||||
<< |
||||
/Font |
||||
<< |
||||
/F1 |
||||
<< |
||||
/Type /Font |
||||
/Subtype /Type1 |
||||
/BaseFont /Arial |
||||
>> |
||||
>> |
||||
>> |
||||
endobj |
||||
6 0 obj |
||||
<</Length 58>> |
||||
stream |
||||
BT/F1 20 Tf 70 88 Td(Should trigger a print action.) Tj ET |
||||
endstream |
||||
endobj |
||||
xref |
||||
0 7 |
||||
0000000000 65535 f |
||||
0000000151 00000 n |
||||
0000000218 00000 n |
||||
0000000275 00000 n |
||||
0000000467 00000 n |
||||
0000000571 00000 n |
||||
0000000685 00000 n |
||||
trailer |
||||
<< |
||||
/Root 1 0 R |
||||
/Size 7 |
||||
>> |
||||
startxref |
||||
791 |
||||
%%EOF |
Loading…
Reference in new issue