Skip to content
This repository has been archived by the owner on Jun 23, 2019. It is now read-only.

Commit

Permalink
Support embedded images
Browse files Browse the repository at this point in the history
fixes #7
  • Loading branch information
languitar committed Jan 1, 2019
1 parent 7368dcc commit e5c6c18
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
2 changes: 1 addition & 1 deletion drawio-batch.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
1 change: 1 addition & 0 deletions test/images.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<mxfile userAgent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) draw.io/8.8.0 Chrome/61.0.3163.100 Electron/2.0.2 Safari/537.36" version="9.4.4" editor="www.draw.io" type="device"><diagram id="ad0e2a76-05ce-e81f-716a-326df6299249" name="Page-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==</diagram></mxfile>

0 comments on commit e5c6c18

Please sign in to comment.