I don't get this. How do I include PurePDF as part of my source instead of lib? I don't see how setting a constant will include it.c4s wrote:Does it mean I don't have to use it as a Userlib any longer? If so, thanks!ABBKlaus wrote:Hint3 : Its now possible to use the PurePDF sources as includefile, just set #PurePDF_Include=1 to something and it will be included
PurePDF Version 2.0
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: PurePDF Version 2.0
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: PurePDF Version 2.0
@Machinecode, sorry it wasn´t well explained
Please look into the "Tutorial32 Unicode.pb" code to get you started.

Please look into the "Tutorial32 Unicode.pb" code to get you started.
Tutorial32 Unicode.pb wrote:#PurePDF_Include=1
XIncludeFile "Source\PurePDF.pb" ; You might want to change the path to the Sources of PurePDF !
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: PurePDF Version 2.0
Sorry, I still don't get it. #PurePDF_Include is only defined ONCE, in the "Tutorial32 Unicode.pb" file, and is NOT referenced anywhere else, such as the source or residents file. So, what's the point of defining it, if there's no other code using it?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
Re: PurePDF Version 2.0
Its used inside the sources of PurePDF :
Code: Select all
CompilerIf Defined(PurePDF_Include,#PB_Constant)
IncludePath #PB_Compiler_FilePath
XIncludeFile "PurePDF_res.pb"
IncludePath ""
CompilerEndIf
...
CompilerIf Defined(PurePDF_Include,#PB_Constant)
pdf_Init()
; - PurePDF commands used as Includefile
Procedure.l pdf_AcceptPageBreak() ;Accept automatic page break or not
ProcedureReturn ipf_AcceptPageBreak()
EndProcedure
...
...
CompilerElse
; - PurePDF commands used as TailBiten Library
ProcedureDLL.l pdf_AcceptPageBreak() ;Accept automatic page break or not
ProcedureReturn ipf_AcceptPageBreak()
EndProcedure
...
...
CompilerEndIf
-
- Addict
- Posts: 1482
- Joined: Tue Feb 22, 2011 1:16 pm
Re: PurePDF Version 2.0
Now I see. I did a search for "#PurePDF_Include", not "PurePDF_Include" (note the hash). 

Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
PureBasic: Born in 1998 and still going strong to this very day!
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PurePDF Version 2.0
Can anyone show me how to use pdf_ImageMem() with a CatchImage()?
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PurePDF Version 2.0
A cut-&-paste from one of my apps, hope it helps:
Then:
Code: Select all
;- Image Globals
Global Image1
Global Image2
;- Catch Images
Image1 = CatchImage(1, ?Image1)
Image2 = CatchImage(2, ?Image2)
;- Images
DataSection
Image1:
IncludeBinary "D:\projects\BpMining\Lubenet.jpg"
Image2:
IncludeBinary "D:\projects\BpMining\Lubenet.png"
EndDataSection
Code: Select all
pdf_Create("P","mm",#PDF_PAGE_FORMAT_A4)
pdf_AddPage()
pdf_SetFillColor(200)
pdf_Rect(35,22,165,5,#PDF_STYLE_FILL)
pdf_Rect(10,110,190,5,#PDF_STYLE_FILL)
pdf_ImageMem("Lubenet.jpg",?Image1,?Image2-?Image1,10,10)
pdf_SetFont("Arial","B",20)
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PurePDF Version 2.0
Ah, that's it thank you - forgot that little trick on how to get the image size.
Just noticed something incredible - the latest Adobe Reader is ~115MB - seems a bit ott.
Just noticed something incredible - the latest Adobe Reader is ~115MB - seems a bit ott.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PurePDF Version 2.0
Tried this to password-protect (weak, but something) a PDF:
......the script fails to execute though. I assume there is too much missing from the script and/or the syntax is incorrect.
Has anyone used pdf_IncludeJS or pdf_IncludeFileJS?
same question from shire: http://www.purebasic.fr/english/viewtop ... 13&t=48538
Edit: OK, got hold of Adobe's PDF Javascript API guide and solved the script issue (not so pretty but it works).
See:http://www.purebasic.fr/english/viewtop ... 89#p369589
Code: Select all
sPdfName.s = "C:\MyPdf.pdf"
pdf_Create("P","mm",#PDF_PAGE_FORMAT_A4)
pdf_AddPage()
pdf_IncludeJS("pass=prompt('enter password',' ');if(pass=='secret')alert('OK');")
pdf_Save(sPdfName)
Has anyone used pdf_IncludeJS or pdf_IncludeFileJS?
same question from shire: http://www.purebasic.fr/english/viewtop ... 13&t=48538
Edit: OK, got hold of Adobe's PDF Javascript API guide and solved the script issue (not so pretty but it works).
See:http://www.purebasic.fr/english/viewtop ... 89#p369589
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PurePDF Version 2.0
Update :
- fixed bug in resource freeing
http://www.purebasicpower.de/?download= ... B45X86.zip
http://www.purebasicpower.de/?download= ... B46X86.zip
BR Klaus
- fixed bug in resource freeing
http://www.purebasicpower.de/?download= ... B45X86.zip
http://www.purebasicpower.de/?download= ... B46X86.zip
BR Klaus
Re: PurePDF Version 2.0
Hi ABBKlaus,
It's my first time on PurePDF. I've downloaded your PDF222-PB46X86 version and I've copied it on my Purebasic Folders.
When I try to compile "Tutorial27 Include File.pb" souce (from examples folder), PBcompiler say:
Do I need to "install" anything more?
BR
It's my first time on PurePDF. I've downloaded your PDF222-PB46X86 version and I've copied it on my Purebasic Folders.
When I try to compile "Tutorial27 Include File.pb" souce (from examples folder), PBcompiler say:
What is wrong?******************************************
PureBasic 4.60 (Windows - x86)
******************************************
Compiling w:\Program Files\PureBasic\Examples\PurePDF\Tutorial27 Include File.pb
Loading external libraries...
Starting compilation...
17 lines processed.
Creating executable "w:\Program Files\PureBasic\Examples\PurePDF\Tutorial27 Include File.exe".
Error: Linker
POLINK: error: Unresolved external symbol '_PB_FindString'.
POLINK: fatal error: 1 unresolved external(s).
Do I need to "install" anything more?
BR
-
- Always Here
- Posts: 6426
- Joined: Fri Oct 23, 2009 2:33 am
- Location: Wales, UK
- Contact:
Re: PurePDF Version 2.0
...it is possibly a Compiler setting. Compiler/Compiler Options, try un-ticking the unicode and thread safe options.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
If it sounds simple, you have not grasped the complexity.
Re: PurePDF Version 2.0
nope. it was my fault, the lib was from 4.51
The archive has now the correct version, compiled with PureBasic 4.61 Beta 1.
[Edit]Should also work with PureBasic 4.60[/Edit]
BR Klaus

The archive has now the correct version, compiled with PureBasic 4.61 Beta 1.
[Edit]Should also work with PureBasic 4.60[/Edit]
BR Klaus
Re: PurePDF Version 2.0
It works fine now.
Thanks for this very very usefull library.
Thanks for this very very usefull library.
- DoubleDutch
- Addict
- Posts: 3220
- Joined: Thu Aug 07, 2003 7:01 pm
- Location: United Kingdom
- Contact:
Re: PurePDF Version 2.0
PurePdf didn't take style into account when embedding fonts. If you had a font with 2 different styles, only one would be embedded... this would result in the 2nd text item being corrupted.
Here is the fixed bits:
.
.
.
Here is the fixed bits:
Code: Select all
Structure PDF_ObjectStructure
Buffer.i ; Buffer
Buflen.i ; Bufferlength
pdfN.i ; when ipf_Put...() is called this is the pointer to the object
vStyle.i ; style
Name$ ; Name of an object
Desc$ ; Description (optional)
CreationDate$ ; The date and time when the embedded file was created.
ModDate$ ; The date and time when the embedded file was last modified.
EndStructure
.
.
Code: Select all
vFound=#False
ForEach FontList()
If FontList()\Name$ = FontName$
If FontList()\vStyle = vStyle
vFound=#True
Break
EndIf
EndIf
Next
; if Font is not already defined load it into memory
If vFound=#False
Mem=0:Len=0
If ipf_Get_Font(hDC,@Mem,@Len)
AddElement(FontList())
FontList()\Name$ = Fonts()\Name$
FontList()\Buffer = Mem
FontList()\Buflen = Len
FontList()\pdfN = 0
FontList()\vStyle = vStyle
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
https://reportcomplete.com <- School end of term reports system