PurePDF as a linux, windows and osx include.

Share your advanced PureBasic knowledge/code with the community.
User avatar
fiver
User
User
Posts: 36
Joined: Wed May 05, 2004 8:21 pm
Location: An outer spiral arm of the Milky Way

PurePDF as a linux, windows and osx include.

Post by fiver »

EDIT: Tested as working on all three platforms, with PB 4.60 RC1.

I have been tinkering with PurePDF by LuckyLuke / DoubleDutch / ABBKlaus and have got it working on Linux and Windows as an include. It should also work on osx (tried with 10.5 leopard) but at the moment it fails with memory errors on CallFunctionFast, which I suspect may be a bug but I'm not certain.

The examples all work on linux and windows with a couple of exceptions: lauching external apps from embedded links on linux (probably because of the nature of the links/the pdf reader I'm using) and also one example that requires one of gnozal's libs that is windows only.

Tested on ububtu 10.10, windows xp and windows vista.

Download from my dropbox account here.

Have fun, fiver.
Last edited by fiver on Sat Sep 10, 2011 1:49 pm, edited 1 time in total.
jamirokwai
Enthusiast
Enthusiast
Posts: 798
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: PurePDF as a linux, windows (and maybe osx) include.

Post by jamirokwai »

fiver wrote:I have been tinkering with PurePDF by LuckyLuke / DoubleDutch / ABBKlaus and have got it working on Linux and Windows as an include. It should also work on osx (tried with 10.5 leopard) but at the moment it fails with memory errors on CallFunctionFast, which I suspect may be a bug but I'm not certain.
Hi fiver,

just replace CallFunctionFast with CallCFunctionFast (with a 'c' after the 'call'), and all should get well :-)
Thanks! That include helps a lot...
Regards,
JamiroKwai
User avatar
DoubleDutch
Addict
Addict
Posts: 3220
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PurePDF as a linux, windows (and maybe osx) include.

Post by DoubleDutch »

Thanks. :)
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
User avatar
Kwai chang caine
Always Here
Always Here
Posts: 5494
Joined: Sun Nov 05, 2006 11:42 pm
Location: Lyon - France

Re: PurePDF as a linux, windows (and maybe osx) include.

Post by Kwai chang caine »

Thanks 8)
ImageThe happiness is a road...
Not a destination
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF as a linux, windows and osx include.

Post by ABBKlaus »

Hi fiver,

Thanks for doing it, the current build of PurePDF should work as an includefile too.

I think the CallfunctionFast() command is buggy on OSX !?

BR Klaus
Ramihyn_
Enthusiast
Enthusiast
Posts: 314
Joined: Fri Feb 24, 2006 9:40 am

Re: PurePDF as a linux, windows and osx include.

Post by Ramihyn_ »

ABBKlaus wrote:I think the CallfunctionFast() command is buggy on OSX !?
There have been (fixed) bugs with CallFunctionFast() in Linux.

See http://www.purebasic.fr/english/viewtop ... 23&t=47239 for example.

As the bug was reported and fixed on Linux recently, i guess you need to report this for Mac OS X if it still happens with RC1 and there is no bug report in the Mac OS X forum so far. Otherwise it will probably be overlooked and you have to wait for 4.61.

Check the generated assembly source for CallFunctionFast() use in PB 4.6 RC1 and maybe check if CallCFunctionFast() in combination with ProcedureC works in Mac OS X. And as usual - if you can -> use the new Prototype Mechanism as CallFunctionFast() is outdated :)

Hope this helps.
User avatar
fiver
User
User
Posts: 36
Joined: Wed May 05, 2004 8:21 pm
Location: An outer spiral arm of the Milky Way

Re: PurePDF as a linux, windows and osx include.

Post by fiver »

It seems that CallFunctionFast is actually ok on osx 10.5 as of PB 4.6RC1, however on Linux Xubuntu 11.04 (recent upgrade I made) it does not work, so I altered the calls to CallCFunctionFast instead of CallFunctionFast and it then worked well. Of course these problems probably all relate to using the bleeding edge version :wink: and I imagine 4.6 final will be much better behaved.

@ABBKlaus Cool! I will take a look.
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: PurePDF as a linux, windows and osx include.

Post by coder14 »

Now that PB is Unicode only, will PurePDF still work? I have not used it before but it is only x86, so will it work with x64 programs? Finally, will it still work with all OS? The forum and downloads look old. Sorry.

Thank you.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF as a linux, windows and osx include.

Post by IdeasVacuum »

I can confirm that it (XIncludeFile) works with Unicode on Windows x86. Do not know about the other platforms but likely will work on Win x64.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
coder14
Enthusiast
Enthusiast
Posts: 327
Joined: Tue Jun 21, 2011 10:39 am

Re: PurePDF as a linux, windows and osx include.

Post by coder14 »

IdeasVacuum wrote:I can confirm that it (XIncludeFile) works with Unicode on Windows x86. Do not know about the other platforms but likely will work on Win x64.
So the program that uses PurePDF can be compiled as x64?

Anyone can confirm about Mac?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF as a linux, windows and osx include.

Post by IdeasVacuum »

Do you have a MAC? Try a code snippet...
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
vwidmer
Enthusiast
Enthusiast
Posts: 286
Joined: Mon Jan 20, 2014 6:32 pm

Re: PurePDF as a linux, windows and osx include.

Post by vwidmer »

Has this been updated anywhere?

I get error trying on linux.

Line 526: Comparisons (=, <, >, =< and >=) are only supported with keywords like If, While, Until or within Bool().

Code: Select all

vReturn = MEM_DataInit(*aData, vMaxSize + (vFind*(vDestLen - vSourceLen))) = #False
Line 829: Native types can't be used with pointers.

Code: Select all

Protected tuple.q, c.l, count.l, err.l, *IPos.l, *OPos.l, i.l
If some one can help. Seems to work if I just comment them out. But not sure how good an idea that is.

Thanks
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
normeus
Enthusiast
Enthusiast
Posts: 472
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: PurePDF as a linux, windows and osx include.

Post by normeus »

This is from the original PurePDF: ( you are missing a ";" on the first line and memory does not have a type anymore on 2nd

Code: Select all

vReturn = MEM_DataInit(*aData, vMaxSize + (vFind*(vDestLen - vSourceLen))); = #False

Code: Select all

  Protected tuple.q,c.l,count.l,err.l,*IPos,*OPos,i.l
Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
vwidmer
Enthusiast
Enthusiast
Posts: 286
Joined: Mon Jan 20, 2014 6:32 pm

Re: PurePDF as a linux, windows and osx include.

Post by vwidmer »

Do you mean there errors or the code? Is there something newer for linux?
Thanks
WARNING: I dont know what I am doing! I just put stuff here and there and sometimes like magic it works. So please improve on my code and post your changes so I can learn more. TIA
normeus
Enthusiast
Enthusiast
Posts: 472
Joined: Fri Apr 20, 2012 8:09 pm
Contact:

Re: PurePDF as a linux, windows and osx include.

Post by normeus »

The lines you referred to, have errors and I looked at the latest PurePDF V2.25 for comparison :

http://www.purebasicpower.de/?PurePDF

If you look at the lines I posted they have been corrected:

1st: now has a "; = #False"

2nd : memory does not have a type anymore in PureBasic ( if you look at the 2nd line of code I pasted you'll see this)

I only use PurePDF in windows and I just realized you might be using an edited special version for linux but even so the code I posted is valid.


Norm.
google Translate;Makes my jokes fall flat- Fait mes blagues tombent à plat- Machte meine Witze verpuffen- Eh cumpari ci vo sunari
Post Reply