It is currently Wed May 22, 2013 8:35 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 299 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16, 17, 18 ... 20  Next
Author Message
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sat Oct 08, 2011 2:18 am 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
c4s wrote:
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
Does it mean I don't have to use it as a Userlib any longer? If so, thanks! :D

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.

_________________
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Oct 09, 2011 10:36 am 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
@Machinecode, sorry it wasn´t well explained :oops:

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 !

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Oct 09, 2011 11:13 am 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
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!


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Oct 09, 2011 11:30 am 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
Its used inside the sources of PurePDF :

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

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sun Oct 09, 2011 12:46 pm 
Offline
Addict
Addict

Joined: Tue Feb 22, 2011 1:16 pm
Posts: 1459
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!


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Tue Nov 01, 2011 4:21 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2854
Location: Wales, UK
Can anyone show me how to use pdf_ImageMem() with a CatchImage()?

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Wed Nov 02, 2011 1:34 am 
Online
Enthusiast
Enthusiast

Joined: Sat Jul 03, 2004 9:04 am
Posts: 163
Location: Sydney Australia
A cut-&-paste from one of my apps, hope it helps:
Code:
;- 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

Then:
Code:
    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)


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Wed Nov 02, 2011 7:56 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2854
Location: Wales, UK
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.

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Mon Dec 05, 2011 3:14 am 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2854
Location: Wales, UK
Tried this to password-protect (weak, but something) a PDF:
Code:
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)
......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/viewtopic.php?f=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/viewtopic.php?f=13&t=48538&p=369589#p369589

_________________
IdeasVacuum
If it sounds simple, you have not grasped the complexity.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Thu Feb 23, 2012 7:32 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
Update :

- fixed bug in resource freeing

http://www.purebasicpower.de/?download=PurePDF222_PB45X86.zip
http://www.purebasicpower.de/?download=PurePDF222_PB46X86.zip

BR Klaus

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Fri Feb 24, 2012 5:31 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Oct 03, 2007 2:38 pm
Posts: 150
Location: To the deal with a pepper
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:
Quote:
******************************************
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).


What is wrong?
Do I need to "install" anything more?

BR


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Fri Feb 24, 2012 6:46 pm 
Offline
Addict
Addict

Joined: Fri Oct 23, 2009 2:33 am
Posts: 2854
Location: Wales, UK
...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.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Fri Feb 24, 2012 10:39 pm 
Offline
Addict
Addict

Joined: Sat Apr 10, 2004 1:20 pm
Posts: 1069
Location: Germany
nope. it was my fault, the lib was from 4.51 :oops:

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

_________________
http://www.PureBasicPower.de


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Sat Feb 25, 2012 9:19 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Wed Oct 03, 2007 2:38 pm
Posts: 150
Location: To the deal with a pepper
It works fine now.
Thanks for this very very usefull library.


Top
 Profile  
 
 Post subject: Re: PurePDF Version 2.0
PostPosted: Tue Mar 13, 2012 9:36 am 
Offline
Addict
Addict
User avatar

Joined: Thu Aug 07, 2003 7:01 pm
Posts: 2853
Location: United Kingdom
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:
Code:
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:
            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

_________________
http://www.SinisterSoft.com <- My Business website
http://www.ReportComplete.com and http://www.ReportPlus.co.uk <- School end of term reports system


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 299 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16, 17, 18 ... 20  Next

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