Page 1 of 3

iSEDQuickPDF Import

Posted: Sun Oct 26, 2003 11:35 pm
by Karbon
Here is the .pbl file that will allow you to import the iSEDQuickPDF DLL available from http://www.sedtech.com/isedquickpdf/.

There are lots of doubles used in this DLL so remember you have to pass the Hi/Lo word to the function so what normally would be 1 argument to a function becomes 2 - this file takes all that into account..

I'll post the actual userlib that the DLLImport tool created over at www.purebasic.org pretty soon if anyone is interested - in the meantime you can roll your own :-)

[edit]

Scroll down and get the PBI file included with iSEDQuickPDf now - it's always up to date!

I'll make a new userlib for this soon for those that want it.

Posted: Mon Oct 27, 2003 10:26 am
by Fred
Nice, I like this library !

Posted: Mon Oct 27, 2003 10:26 pm
by Karbon
I just finished an invoice generation program a few minutes ago that spits out PDFs using this DLL. I'm very very very pleased. I've used to the pdflib.com library but this one seems just as good and a LOT cheaper!

If anyone is interested in easily making PDFs in PB : http://www.sedtech.com/isedquickpdf/

Posted: Tue Oct 28, 2003 10:30 am
by benny
Thats sounds very interesting. Will have a look on it in the future.
Thanx for sharing the .pbi file.

Posted: Tue Oct 28, 2003 7:35 pm
by Karbon
I've updated it several times so grab a new copy if you're using it.

Posted: Thu Oct 30, 2003 4:29 am
by Karbon
I posted the userlibs and such over at http://www.purebasic.org - pick 'em up if you need them..

Thanks to freedimension for that doubles userlib!

iSEDQuickPDF import file

Posted: Thu Feb 26, 2004 2:42 am
by sedtech
PureBasic users,

We've put together an automatic PureBasic import file generator as part of our build process.

The latest version of iSEDQuickPDF (4.11) can be downloaded from our website. The iSQP0411DLL.zip archive contains an iSQP0411.pbi file which should work nicely with PureBasic. As per the original post the software can be downloaded from the iSEDQuickPDF Website

We've tested many of the iSEDQuickPDF functions using the evaluation edition of PureBasic, but did run into the 800-line limit so couldn't test the entire import file.

The import file allows simple programs like this to be written:

Code: Select all

IncludeFile "c:\isedquickpdf\iSQP0399.pbi"

OpenConsole()
iSEDInit("c:\isedquickpdf\")
PrintN(Str(iSEDUnlockKey(" ... license key here ... ")))
PrintN(Str(iSEDDrawText(100, 500, "Hello")))
PrintN(Str(iSEDSaveToFile("c:\pb.pdf")))
Input()
We would be interested to find out if there is any way we can improve this import file. As mentioned previously, the file itself is generated automatically as part of our build process so a fresh file will be available each time we release a new version of iSEDQuickPDF.

Looking forward to any feedback we may receive.

Regards,
Kevin

--
Kevin Newman
Managing Director
SEDTech (Pty) Ltd.
http://www.sedtech.com/isedquickpdf/

Posted: Thu Feb 26, 2004 3:17 am
by Karbon
I can't say enough good things about this library - I've really put it through it's paces (from PB) and have been VERY impressed so far..

Sedtech: I will be testing the include file like crazy as I move away from my hackish solution to your more elegant one.

The only thing right off the bat that might be useful is to get the address of the functions using PB's IsFunction() procedure so that the CallFunction() calls can become CallFunctionFast() calls. In tests there is a measurable performance increase.

I'd be happy to do and send the result if you can't or don't want to!

Thanks!

PDF LIB LIBRARY

Posted: Thu Feb 26, 2004 3:31 am
by NoahPhense
Fred wrote:Nice, I like this library !
The latest release.. 4.11 was released today.

I've been communicating with Doug over there, I purchased this a while
back to create a pdf app for work, using PB.

He created this and it is now included with all future releases.


Here is only a sample.. as the forums will not take the whole .pbi

Code: Select all

;======================================================================================
;iSEDQuickPDF 4.11
;PureBasic header file
;26 February 2004
;http://www.sedtech.com/isedquickpdf
;======================================================================================

#ISQP=1
Structure iSQPDouble
Hi.l
Lo.l
EndStructure
Procedure MakeiSQPDouble(LONG.f, ADDRESS.l)
  !FLD dword [ Esp ]
  !MOV dword Eax, [ Esp + 4 ]
  !FSTP qword [ Eax ]
EndProcedure
Procedure.f CatchDoubleReturn(*x.iSQPDouble)
  !MOV  dword EAX,[ESP]
  !FST  qword [EAX]
  !MOV  dword EAX,[ESP]
  !FLD  qword [EAX]
EndProcedure
Procedure iSEDInit(Path.s)
  OpenLibrary(#ISQP, Path + "iSEDQuickPDF.dll");
EndProcedure
Procedure.l iSEDAddLinkToJavaScript(Left.f, Top.f, Width.f, Height.f, JavaScript.s, Options.l)
  dLeft.iSQPDouble
  dTop.iSQPDouble
  dWidth.iSQPDouble
  dHeight.iSQPDouble
  MakeiSQPDouble(Left.f, @dLeft)
  MakeiSQPDouble(Top.f, @dTop)
  MakeiSQPDouble(Width.f, @dWidth)
  MakeiSQPDouble(Height.f, @dHeight)
  ProcedureReturn CallFunction(#ISQP, "iSEDAddLinkToJavaScript", dLeft\Hi, dLeft\Lo, dTop\Hi, dTop\Lo, dWidth\Hi, dWidth\Lo, dHeight\Hi, dHeight\Lo, JavaScript, Options)
EndProcedure
Procedure.l iSEDAddLinkToPage(Left.f, Top.f, Width.f, Height.f, Page.l, Position.f, Options.l)
  dLeft.iSQPDouble
  dTop.iSQPDouble
  dWidth.iSQPDouble
  dHeight.iSQPDouble
  dPosition.iSQPDouble
  MakeiSQPDouble(Left.f, @dLeft)
  MakeiSQPDouble(Top.f, @dTop)
  MakeiSQPDouble(Width.f, @dWidth)
  MakeiSQPDouble(Height.f, @dHeight)
  MakeiSQPDouble(Position.f, @dPosition)
  ProcedureReturn CallFunction(#ISQP, "iSEDAddLinkToPage", dLeft\Hi, dLeft\Lo, dTop\Hi, dTop\Lo, dWidth\Hi, dWidth\Lo, dHeight\Hi, dHeight\Lo, Page, dPosition\Hi, dPosition\Lo, Options)
EndProcedure
Procedure.l iSEDAddLinkToWeb(Left.f, Top.f, Width.f, Height.f, Link.s, Options.l)
  dLeft.iSQPDouble
  dTop.iSQPDouble
  dWidth.iSQPDouble
  dHeight.iSQPDouble
  MakeiSQPDouble(Left.f, @dLeft)
  MakeiSQPDouble(Top.f, @dTop)
  MakeiSQPDouble(Width.f, @dWidth)
  MakeiSQPDouble(Height.f, @dHeight)
  ProcedureReturn CallFunction(#ISQP, "iSEDAddLinkToWeb", dLeft\Hi, dLeft\Lo, dTop\Hi, dTop\Lo, dWidth\Hi, dWidth\Lo, dHeight\Hi, dHeight\Lo, Link, Options)
EndProcedure
; Too many paramters for AddNoteAnnotation
Procedure.s iSEDGetCatalogInformation(Key.s)
  r.l = CallFunction(#ISQP, "iSEDGetCatalogInformation", Key)
  s.l = CallFunction(#ISQP, "iSEDStringResultLength")
  ProcedureReturn PeekS(r, s)
EndProcedure
Procedure.l iSEDSetCatalogInformation(Key.s, NewValue.s)
  ProcedureReturn CallFunction(#ISQP, "iSEDSetCatalogInformation", Key, NewValue)
EndProcedure
Procedure.l iSEDGetDestPage(DestID.l)
  ProcedureReturn CallFunction(#ISQP, "iSEDGetDestPage", DestID)
EndProcedure
Procedure.l iSEDGetDestType(DestID.l)
  ProcedureReturn CallFunction(#ISQP, "iSEDGetDestType", DestID)
EndProcedure
Procedure.f iSEDGetDestValue(DestID.l, ValueKey.l)
  CallFunction(#ISQP, "iSEDGetDestValue", DestID, ValueKey)
  ProcedureReturn CatchDoubleReturn(dummy.iSQPDouble)
EndProcedure
Procedure.l iSEDCompressContent()
  ProcedureReturn CallFunction(#ISQP, "iSEDCompressContent")
EndProcedure
Procedure.l iSEDCompressPage()
  ProcedureReturn CallFunction(#ISQP, "iSEDCompressPage")
EndProcedure
Procedure.l iSEDDocumentCount()
  ProcedureReturn CallFunction(#ISQP, "iSEDDocumentCount")
EndProcedure
Procedure.l iSEDDocumentID(Index.l)
  ProcedureReturn CallFunction(#ISQP, "iSEDDocumentID", Index)
EndProcedure

This library kicks as$ .. trust me. And their support is outrageous.
Once you are a paying user, you have your OWN forum, where you
deal ONE-ON-ONE with a tech.. it couldn't be any better..

- np

ps - this file is now included in the 4.11 release.. the import file has 1450
lines of code in it... ;)

Posted: Sat Mar 06, 2004 8:14 am
by clipper
Hallo sedtech,

great library and thanks for PB-support with your import file!!

To reduce Overhead in my PB-Software, I take your
include, copy the functions I need and paste them in a new, shorter includefile.
At this point it would be very nice if you put the
FPxxxx = IsFunction(#ISQP, "iSEDxxxx")
together with the corresponding function.

iSEDQuickPDF offers so many functions :D so that it´s very hard to find
them in the large include.

what do you thin about this

Posted: Sat Mar 06, 2004 5:11 pm
by Num3
Here's a more complex example :

Code: Select all

IncludeFile "iSQP0412.pbi"

OpenConsole()

iSEDInit("")
PrintN(Str(iSEDUnlockKey(" ... license key here ... ")))
PrintN(Str(iSEDDrawTextBox(100, 500, 150,80,"Hello World.... this actually works out very well!!!",0)))
PrintN(Str(iSEDDrawBarcode(100, 700, 150,20,"Barcode",1,0)))
PrintN(Str( iSEDDrawBox(80,500,250,180,0 )))
PrintN(Str(iSEDCompressPage())) ; Compress this PDF page to save space
perm.l=iSEDPermissions(1,0,0,0,0,0,0,1) ; Generate permission number
PrintN(Str(iSEDEncrypt("purebasic01","",0,perm))) ; Apply Encriptation and permissions
PrintN(Str(iSEDSaveToFile("pb.pdf")))

Input()

Posted: Sat Mar 06, 2004 8:14 pm
by Num3
Just has a note, I've created a Purebasic UserLibrary for this DLL.

I just edited the include PBI file and used TAILBite to convert it to a Library...

Worked like a charm :mrgreen:

Posted: Mon Mar 08, 2004 3:20 pm
by blueb
Num 3,

What changes did you have to make to the PBI file?

Since I recently installed TailBite, I'd also be interested in making a lib. As I understand, libs only include the functions you need at compile time. Therefore clipper would not need to cut and paste to get a smaller include file.


Thanks in advance,
blueb

Posted: Mon Mar 08, 2004 8:33 pm
by Num3
I changed all procedures like this:

Original

Code: Select all

Procedure.l iSEDMergeFiles(FirstFileName.s, SecondFileName.s, OutputFileName.s)
  ProcedureReturn CallFunctionFast(FPMergeFiles, FirstFileName, SecondFileName, OutputFileName)
EndProcedure
New

Code: Select all

ProcedureDLL.l PDF_MergeFiles(FirstFileName.s, SecondFileName.s, OutputFileName.s)
  ProcedureReturn CallFunctionFast(FPMergeFiles, FirstFileName, SecondFileName, OutputFileName)
EndProcedure
Afterwords i runned tailbite on it :D

Posted: Tue Mar 09, 2004 3:41 am
by blueb
Thanks Num3,

I'll give that a try. :)

blueb