Created
November 5, 2016 05:03
-
-
Save x86128/b15bb5f90c3cffd0c1034615eb8b26b1 to your computer and use it in GitHub Desktop.
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
import streams, "source/nimpdf" | |
var fo = newFileStream("book.pdf", fmWrite) | |
var doc = initPDF() | |
let pSize = getSizeFromName("A4") | |
var yPos = 15'f64 | |
doc.addPage(pSize, PGO_PORTRAIT) | |
doc.setFont("monospace", {FS_REGULAR}, 5'f64, ENC_UTF8) | |
doc.drawText(15, yPos, "Обычный текст в кодировке UTF-8") | |
doc.writePDF(fo) | |
close(fo) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment