From e5c6c181fad43d06b2da1dc10ecc8f85200a30ab Mon Sep 17 00:00:00 2001 From: Johannes Wienke Date: Tue, 1 Jan 2019 17:07:18 +0100 Subject: [PATCH] Support embedded images fixes #7 --- drawio-batch.js | 2 +- test.sh | 6 ++++++ test/images.xml | 1 + 3 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 test/images.xml diff --git a/drawio-batch.js b/drawio-batch.js index 1110f63..a29fd3e 100755 --- a/drawio-batch.js +++ b/drawio-batch.js @@ -60,7 +60,7 @@ program const puppeteer = require('puppeteer'); (async () => { - const browser = await puppeteer.launch({args: ['--no-sandbox']}) + const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-web-security']}) try { await input diff --git a/test.sh b/test.sh index a2b1f6d..ff858ce 100755 --- a/test.sh +++ b/test.sh @@ -28,3 +28,9 @@ rm test.pdf node drawio-batch.js -d 1 ./test/multipleSheets.xml test.pdf pdftotext test.pdf - | grep BoxOnSheetTwo rm test.pdf + +# check external images work +node drawio-batch.js -d 1 ./test/images.xml test.pdf +# if that doesn't work, the PDF is much smaller because no images are embedded +test "$(stat --printf='%s' test.pdf)" -ge 4000 +rm test.pdf diff --git a/test/images.xml b/test/images.xml new file mode 100644 index 0000000..598a558 --- /dev/null +++ b/test/images.xml @@ -0,0 +1 @@ +1ZjLjpswFIafJtsIMNdlh0mmi1aqNIsukYMdsMbY1HYS0qevCYaEQCZTJVGEWID/48vhfD7GZgbionoTsMx/coTpzLFQNQOvM8exbdvSt1rZN0rkuY2QCYJMpaPwTv5iI5p22YYgLHsVFedUkbIvppwxnKqeBoXgu361Naf9UUuY4YHwnkI6VH8TpPLWO8s6Gr5jkuVmaK81FLCtbASZQ8R3JxJYzEAsOFfNU1HFmNbBa+PStFtesHaOCczUVxo4TYMtpBvzbsYvtW9flm8UJQzHXSytGXhBUOYYmcIWC0V0dH7AFaa/uCSKcKZtK64UL04qfKMkqw2Kl1qFppRqX7HQQq4Kqsu2ftRxKevxiyqrp9Ac7iSY6+BhBrV1TSiNOeXi4CFYeqEHXK3ruojo3lob40x38mLeUTuBq4txsrvo62mLeYGV2OsqpkFoeJkJ65ri7kg/8OdeI+Yn5I8qNHMu6/o+YtEPhsw4JTAlSinlGyQxFGn+FFRdbv0vqwjcTsqdEqk/G5J+yCYA56As6yVYPhaUa52BCgegfGuIqdVuweRNCRMsyFMSyTtPJO9rfO6QRv6U+GAKpe4noRyiZAUpZClh2VOQ+e5VZI9b+4IpQUOrhLOEMKk0LvwUWEGflRMNP1Sj+eXeY0sRTgnWtkwTBlWSQYV3cH+Blv/gbUXYxxX6Q1zRyA7QuR1WNClYRKgNpEkpyFbzSg77wackGIisNlU+gRZEYwtieyK9BVt7XP2M21UqJ+EeBySV4B/dOdQeQ3Z9cozWGMOL6mR8u5SHi7i+OqdOLN6ivmrnZNmMsCZVPfx9diruGebhUmrb/jwYcrYtZx7eAbU9pRSVjO/0RoWOALR0LMFjP3vg7LsXOsOFNBjLydC+A6hJ/fEgRcmFSnBV355CKzw/pI3Acsdg3eMYYE/qxweCCq6gxElBtFoPkkgstmRse+k5kRsvH0suDK7mWbs5uTHLdPH4y/JgO/nxCxb/AA== \ No newline at end of file