-
-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #194 from julianhille/feature/191-append-issue
Fix append pages when stream is not readable
- Loading branch information
Showing
4 changed files
with
17 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,21 @@ | ||
const muhammara = require('../muhammara'); | ||
const expect = require('chai').expect; | ||
|
||
describe('AppendPagesTest', function() { | ||
it('should complete without error', function() { | ||
var pdfWriter = require('../muhammara').createWriter(__dirname + '/output/AppendPagesTest.pdf'); | ||
|
||
var pdfWriter = muhammara.createWriter(__dirname + '/output/AppendPagesTest.pdf'); | ||
pdfWriter.appendPDFPagesFromPDF(__dirname + '/TestMaterials/Original.pdf'); | ||
pdfWriter.appendPDFPagesFromPDF(__dirname + '/TestMaterials/XObjectContent.PDF'); | ||
pdfWriter.appendPDFPagesFromPDF(__dirname + '/TestMaterials/BasicTIFFImagesTest.PDF'); | ||
|
||
pdfWriter.end(); | ||
}); | ||
|
||
it('should throw an error instead of a crash', () => { | ||
var writerBuffer = new muhammara.PDFWStreamForBuffer([]); | ||
var pdfWriter = muhammara.createWriter(writerBuffer) | ||
expect(() => | ||
pdfWriter.appendPDFPagesFromPDF(__dirname + '/TestMaterials/appendbreaks.pdf') | ||
).to.throw('unable to append') | ||
}) | ||
}); |
Binary file not shown.