It is currently Sat Dec 14, 2019 10:57 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Viewing a generated PDF
PostPosted: Fri Oct 06, 2017 7:25 am 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1046
Location: Portugal
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/viewtopic.php?f=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.


Top
 Profile  
Reply with quote  
 Post subject: Re: Viewing a generated PDF
PostPosted: Fri Oct 06, 2017 8:44 am 
Offline
Enthusiast
Enthusiast

Joined: Sat Feb 08, 2014 3:26 pm
Posts: 718
First test:

  • Avoid using space in filename
  • Avoid using virtual folder
  • Be sure to have acces write in output folder

Try this:
Code:
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

_________________
(English is not my native language, I use an online translator)
Windows 10 Family x64 + Linux (Slackware, Debian on Oracle VirtualBox 6.0) + Raspberry Pi


Top
 Profile  
Reply with quote  
 Post subject: Re: Viewing a generated PDF
PostPosted: Fri Oct 06, 2017 8:53 am 
Offline
Addict
Addict

Joined: Fri Aug 28, 2015 6:10 pm
Posts: 1046
Location: Portugal
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.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye