Viewing a generated PDF

Linux specific forum
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Viewing a generated PDF

Post 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
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Marc56us
Addict
Addict
Posts: 1477
Joined: Sat Feb 08, 2014 3:26 pm

Re: Viewing a generated PDF

Post 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
collectordave
Addict
Addict
Posts: 1309
Joined: Fri Aug 28, 2015 6:10 pm
Location: Portugal

Re: Viewing a generated PDF

Post 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
Any intelligent fool can make things bigger and more complex. It takes a touch of genius — and a lot of courage to move in the opposite direction.
Post Reply