Page 1 of 1

Viewing a generated PDF

Posted: Fri Oct 06, 2017 7:25 am
by collectordave
Just adding this in the LINUX forum for completeness.

Had a problem displaying a generated PDF (purePDF) on Linux. Adobe not supporting PDFReader on Linux.

Think I found a solution posted here http://www.purebasic.fr/english/viewtop ... 19&t=69232

If any Linux gurus can see any problems then please let me know.

Regards

CD

Re: Viewing a generated PDF

Posted: Fri Oct 06, 2017 8:44 am
by Marc56us
First test:
  • Avoid using space in filename
  • Avoid using virtual folder
  • Be sure to have acces write in output folder
Try this:

Code: Select all

XIncludeFile "PurePdfModule.pbi"

PDF::AddPage() 
PDF::SetFont("Arial","",20)
PDF::Cell(100,100,"Hello World !")

File_Name.s = GetTemporaryDirectory() + "PDF_Test.pdf"
PDF::Save(File_Name)

Debug "File Size: " + FileSize(File_Name)

If RunProgram("evince", File_Name, "")
  Debug "OK"
Else
  Debug "Can't launch document:" + File_Name
EndIf
Tested on Linux Debian 8 x64 / xfce

Re: Viewing a generated PDF

Posted: Fri Oct 06, 2017 8:53 am
by collectordave
Thanks

Managed to catch those i think.

Putting chr(34) round filename seems to work well.

I am using the home documents folder of the logged on user to create and write the files. Works on my new installation.

Just hit the/ and \ bit on paths but getting over that.

Is there a public place for documents so all could share on the same PC.

Sorry to sound a litle stupid only had Linux and PB running for 24 Hours now.

Kind Regards

CD