PurePDF Version 2.0

Developed or developing a new product in PureBasic? Tell the world about it.
walker
Enthusiast
Enthusiast
Posts: 634
Joined: Wed May 05, 2004 4:04 pm
Location: Germany

Re: PurePDF Version 2.0

Post by walker »

unfortunately PurePDF causes an ima with 4.50b4 (win x86) :(
with 4.50b3 it was working ....
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Yes i noticed this too, recompiled with Beta4 and should be up now :wink:

(since i haven´t changed the filename you have to redownload, if behind a proxy pressing CONTROL should help !)

BR Klaus
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Re: PurePDF Version 2.0

Post by merendo »

I'm afraid I may have discovered a bug in PurePDF (or my own code...). I started a separate thread for it. See here: http://www.purebasic.fr/english/viewtop ... 13&t=42431. It's about the function pdf_AliasNbPages().
The truth is never confined to a single number - especially scientific truth!
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

thanks merendo for the info, the bug was in MEM_DataReplace() allocating a memorybuffer slightly too small ;-)

BR Klaus

Download :

PurePDF V2.16 for PB4.4x X86
PurePDF V2.16 for PB4.50 X86
merendo
Enthusiast
Enthusiast
Posts: 449
Joined: Sat Apr 26, 2003 7:24 pm
Location: Germany
Contact:

Re: PurePDF Version 2.0

Post by merendo »

Terrific!! Works just fine now, thanks a lot!

Edit: And thanks for the tribute to me in the version history ;)
The truth is never confined to a single number - especially scientific truth!
User avatar
STARGÅTE
Addict
Addict
Posts: 2089
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: PurePDF Version 2.0

Post by STARGÅTE »

thx for this Lib, but the exampels not run:
Tutorial02 Header-Footer.pb wrote: #PDF_ALIGN_CENTER is missing ! (ans other too)
PurePDF Version 2.16 ; PB 4.50 ; Windows XP SP3
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

STARGÅTE wrote:thx for this Lib, but the exampels not run:
Tutorial02 Header-Footer.pb wrote: #PDF_ALIGN_CENTER is missing ! (ans other too)
PurePDF Version 2.16 ; PB 4.50 ; Windows XP SP3
i can´t reproduce it here, do you have the resident installed correctly ?
User avatar
STARGÅTE
Addict
Addict
Posts: 2089
Joined: Thu Jan 10, 2008 1:30 pm
Location: Germany, Glienicke
Contact:

Re: PurePDF Version 2.0

Post by STARGÅTE »

ah thx, had only copy the Lib
PB 6.01 ― Win 10, 21H2 ― Ryzen 9 3900X, 32 GB ― NVIDIA GeForce RTX 3080 ― Vivaldi 6.0 ― www.unionbytes.de
Lizard - Script language for symbolic calculations and moreTypeface - Sprite-based font include/module
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

here´s a slightly improved version for download.
PurePDF v2.17 wrote:- added pdf_RoundRect(X.f, Y.f, W.f, H.f, R.f [, Style$])
(feature request was made by Num3)
Download :
PurePDF V2.17 for PB4.50 X86

BR Klaus
User avatar
Thorsten1867
Addict
Addict
Posts: 1366
Joined: Wed Aug 24, 2005 4:02 pm
Location: Germany

Re: PurePDF Version 2.0

Post by Thorsten1867 »

I think, I found a bug. Try this:

Code: Select all

  pdf_Create("P", "mm", #PDF_PAGE_FORMAT_A4)
  pdf_AddPage()
  ; --- ohne Akzent ------------
  pdf_SetFont("Arial", "U", 16)
  lenVN = pdf_GetStringWidth("Andre") + 1
  pdf_Cell(0, 6, "Andre", 0, 1)
  ; --- mit Akzent ------------
  pdf_SetFont("Arial", "U", 16)
  lenVN = pdf_GetStringWidth("André") + 1
  pdf_Cell(0, 6, "André", 0, 1)
  ; ----------------------------
  pdf_Save("Test.pdf")
Underline does'nt work correct, if I there is an accent.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Yes it was the implementation of octal encoding that causes pdf_cell to fail on this.

I will fix it asap :wink:

BR Klaus
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Hi,

here is a new version of PurePDF.
fixed a bug in pdf_Cell() found by Thorsten1867
added new path functions:
- pdf_PathBegin()
- pdf_PathArc()
- pdf_PathLine()
- pdf_PathRect()
- pdf_PathEnd()
BR Klaus

Download :

PurePDF V2.19 for PB4.3x X86
PurePDF V2.19 for PB4.4x X86
PurePDF V2.19 for PB4.50 X86
thefool
Always Here
Always Here
Posts: 5881
Joined: Sat Aug 30, 2003 5:58 pm
Location: Denmark

Re: PurePDF Version 2.0

Post by thefool »

I finally decided to upgrade from purebasic 4.0 to 4.5 for the PDF-generators at work (had to do a few small fixes), just to find that it works with no changes to the source code with the new library. Thanks a lot for continuing to update and maintain this :)
PureGuy
Enthusiast
Enthusiast
Posts: 102
Joined: Mon Aug 30, 2010 11:51 am

Re: PurePDF Version 2.0

Post by PureGuy »

hello :D

I know this is a bit off topic but can someone give me an example how i can use the

ipf_ASCII85_Encode and ipf_ASCII85_Decode function from PurePDF

to convert any binary file into a ASCII85 encoded text file and vise versa?
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Hello PureGuy,

this example should get you started.

BR Klaus

Code: Select all

Demodata$="START"+Chr(13)
For i=1 To 32
  Demodata$+"This text is encoded with ASCII85 !"+Chr(13)
Next
Demodata$+"END"

ASCII85.MEM_DataStructure
ASCII85\pData=AllocateMemory(Len(Demodata$)+2)
ASCII85\lCurSize=Len(Demodata$)
ASCII85\lMaxSize=Len(Demodata$)+2
PokeS(ASCII85\pData,Demodata$,-1,#PB_Ascii)

Characters_per_line=60
If pdf_ASCII85_Encode(@ASCII85,Characters_per_line)
  Message$=Chr(13)+Chr(13)+"Buffer = "+Str(ASCII85\lCurSize)+" Bytes !"
  Encoded_ASCII85$=PeekS(ASCII85\pData,-1,#PB_Ascii)
  MessageRequester("ASCII85 Encode",Encoded_ASCII85$+Message$)
  
  BufferLen=4096
  Buffer=AllocateMemory(BufferLen)
  If pdf_ASCII85_Decode(ASCII85\pData,ASCII85\lCurSize,Buffer,@OutBufferLen)=0
    Message$=Chr(13)+Chr(13)+"Buffer = "+Str(OutBufferLen)+" Bytes !"
    Decoded_ASCII85$=PeekS(Buffer,-1,#PB_Ascii)
    MessageRequester("ASCII85 Decoded",Decoded_ASCII85$+Message$)
  EndIf
EndIf
Post Reply