[Done] StartVectorDrawing(PdfVectorOutput()) ERROR on PDF Create

Post bugreports for the Windows version here
normeus
Enthusiast
Enthusiast
Posts: 484
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

[Done] StartVectorDrawing(PdfVectorOutput()) ERROR on PDF Create

Post by normeus »

Run the example code from PdfVectorOutput(), for the filename use a nonexistent path so that the file cannot be created
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.12 LTS x64 Windows 11 pro and PB6.30 Beta 4 x64 Windows 11 home

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
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
freak
PureBasic Team
PureBasic Team
Posts: 5950
Joined: Fri Apr 25, 2003 5:21 pm
Location: Germany

Re: StartVectorDrawing(PdfVectorOutput()) ERROR on PDF Create

Post by freak »

fixed.
quidquid Latine dictum sit altum videtur
Post Reply