File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2000,7 +2000,7 @@ class PDFEditor {
20002000 const resourcesValuesCache = new Map ( ) ;
20012001 for ( const field of drToFix ) {
20022002 const ap = field . get ( "AP" ) ;
2003- for ( const value of ap . getValues ( ) ) {
2003+ for ( const [ , value ] of ap ) {
20042004 if ( ! ( value instanceof BaseStream ) ) {
20052005 continue ;
20062006 }
Original file line number Diff line number Diff line change 906906! issue13520.pdf
907907! 22060_A1_01_Plans.pdf
908908! issue21126.pdf
909+ ! bug2035197_1.pdf
910+ ! bug2035197_2.pdf
Original file line number Diff line number Diff line change @@ -6586,6 +6586,29 @@ small scripts as well as for`);
65866586
65876587 await loadingTask . destroy ( ) ;
65886588 } ) ;
6589+
6590+ it ( "merges PDFs with conflicting AcroForm /DR (bug 2035197)" , async function ( ) {
6591+ // Two PDFs with different `AcroForm.DR`.
6592+ const loadingTask = getDocument (
6593+ buildGetDocumentParams ( "bug2035197_1.pdf" )
6594+ ) ;
6595+ const pdfDoc = await loadingTask . promise ;
6596+ const pdfData2 = await DefaultFileReaderFactory . fetch ( {
6597+ path : TEST_PDFS_PATH + "bug2035197_2.pdf" ,
6598+ } ) ;
6599+
6600+ const data = await pdfDoc . extractPages ( [
6601+ { document : null } ,
6602+ { document : pdfData2 } ,
6603+ ] ) ;
6604+ expect ( data ) . not . toBeNull ( ) ;
6605+ await loadingTask . destroy ( ) ;
6606+
6607+ const newLoadingTask = getDocument ( data ) ;
6608+ const newPdfDoc = await newLoadingTask . promise ;
6609+ expect ( newPdfDoc . numPages ) . toEqual ( 2 ) ;
6610+ await newLoadingTask . destroy ( ) ;
6611+ } ) ;
65896612 } ) ;
65906613
65916614 describe ( "Outlines" , function ( ) {
You can’t perform that action at this time.
0 commit comments