-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
327a82f
commit 8366500
Showing
3 changed files
with
44 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
describe('podofo.js', () => { | ||
it('simple paint', async () => { | ||
const Podofo = global.Podofo; | ||
|
||
const document = new Podofo.Document(); | ||
const size = Podofo.getPageSize(Podofo.PageSize.A4, false); | ||
const page = document.getPages() | ||
.createPage(size); | ||
|
||
|
||
const painter = new Podofo.Painter(); | ||
painter.setCanvas(page); | ||
painter.drawCircle(100, 500, 20, Podofo.PathDrawMode.Fill); | ||
painter.finishDrawing(); | ||
}); | ||
}); |
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
const writeToFile = (buffer, name) => { | ||
const filePath = path.join(__dirname, name); | ||
fs.writeFileSync(filePath, buffer); | ||
} | ||
|
||
module.exports = { writeToFile }; |