a. If you are running the code from the editor, the program will be killed, the error is "The specified 'Output' is not valid.
b. if you are running a compiled program, there is no error, but you have no idea that the PDF file was not created.
Code: Select all
LoadFont(0, "Times New Roman", 20)
If StartVectorDrawing(PdfVectorOutput("D:\expelliarmus\test.pdf", 595, 842))
VectorFont(FontID(0), 25)
MovePathCursor(20, 20)
DrawVectorText("This is page 1...")
NewVectorPage()
MovePathCursor(20, 20)
DrawVectorText("This is page 2...")
StopVectorDrawing()
MessageRequester("Success","PDF file was created")
Else
MessageRequester("Error","PDF file could not be created")
EndIf
MessageRequester("Done","The program has succesfully ended")
PB6.21 x64 Linux mint ( I only tried the editor on this one and I received the "Output" error when using wrong path )
In Windows, I did notice that PdfVectorOutput() returns a pointer, and if it couldn't open the file it returns a 1 (number one is not usually a pointer )
In linux, it returns a 0 if it couldn't open an output file.
I hope I placed this post in the right location.
Thank you.
Norm

