-
Notifications
You must be signed in to change notification settings - Fork 10
/
doc.txt
33 lines (23 loc) · 844 Bytes
/
doc.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#Quick Start
this is an axample of "Hello World" using nimPDF
import streams, nimpdf
proc main(): bool {.discardable.} =
var fileName = "hello.pdf"
var file = newFileStream(fileName, fmWrite)
if file != nil:
var doc = initPDF()
let size = getSizeFromName("A4")
doc.addPage(size, PGO_PORTRAIT)
doc.setFont("Helvetica", {FS_BOLD}, 5)
doc.drawText(15, 15, "Hello World!")
doc.writePDF(file)
file.close()
return true
echo "cannot open: ", fileName
result = false
main()
#How To Compile
This is example for windows. make sure your PATH already set
>set path=c:\mingw\bin;c:\nim\bin
then
>nim c --path:c:\nimPDF\source --path:c:\nimPDF\subsetter --cincludes:c:\nimPDF\source hello.nim