PurePDF Version 2.0

Developed or developing a new product in PureBasic? Tell the world about it.
PureGuy
Enthusiast
Enthusiast
Posts: 102
Joined: Mon Aug 30, 2010 11:51 am

Re: PurePDF Version 2.0

Post by PureGuy »

Thanks Klaus,

I got the decoding part to work :D

but i don't understand how to pass the content of a file to encode function :?:
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Code: Select all

If ReadFile(0,"C:\somefile.txt")
  ASCII85.MEM_DataStructure
  ASCII85\pData=AllocateMemory(Lof(0))
  ASCII85\lCurSize=Lof(0)
  ASCII85\lMaxSize=Lof(0)
  ReadData(0,ASCII85\pData,Lof(0))
  CloseFile(0)
  
  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
EndIf
RichardL
Enthusiast
Enthusiast
Posts: 532
Joined: Sat Sep 11, 2004 11:54 am
Location: UK

Re: PurePDF Version 2.0

Post by RichardL »

Hi,
I have used the pdf library with a lot of success. Many thanks.

In one application I have a full page background picture over which I print text and also place a logo, which is in PNG format. This works very well except I cannot find how to make the borders to the logo transparent, so my logo appears in a rectangular white box. The docs for pdf_Image() say that I need to specify a transparent colour, but I don't know how to do this. Can it be done with MS Paint or Paint.net?

Any suggestions are most welcome.

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

Re: PurePDF Version 2.0

Post by ABBKlaus »

i think the documenation is wrong on that part because it says :
but are not supported:
- interlacing
- alpha channel
BR Klaus
c4s
Addict
Addict
Posts: 1981
Joined: Thu Nov 01, 2007 5:37 pm
Location: Germany

Re: PurePDF Version 2.0

Post by c4s »

Regarding the images I have some questions and ideas:
- Is it possible to add a paperless format or is something like this already implemented?
- We can add images by full filename or memory address, I think it would be good to just pass a PureBasic ImageNr as well. Is there a restriction or could this be done easily?
- How can I add an image so that it always fits best the paper size and without loss of resolution?
If any of you native English speakers have any suggestions for the above text, please let me know (via PM). Thanks!
OddSoul
New User
New User
Posts: 1
Joined: Thu Feb 24, 2011 4:07 pm

Re: PurePDF Version 2.0

Post by OddSoul »

How to change a space between lines in PurePDF? I want to change a space between lines in document with PurePDF but i cannot find a way to do it. I used Chunk and Paragraph for output text but they haven't any properties to change space between lines. Please help.

Sorry for my bad English =)
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

With this PurePDF it could look like this :

Code: Select all

pdf_Create()
pdf_AddPage()
pdf_SetMargins(30,10,30)
pdf_SetFont("Arial","",12)

txt$ = "Test"
pdf_SetX(30)
pdf_Write(5,txt$)
pdf_Ln(4)
pdf_Write(5,txt$)
pdf_Ln(5)
pdf_Write(5,txt$)
pdf_Ln(6)
pdf_Write(5,txt$)
pdf_Ln(7)
pdf_Write(5,txt$)

pdf_Save("Test.pdf")
But i guess you are looking for the purepdf Flash/Actionscript library for creating PDF files ;-)
http://code.google.com/p/purepdf/
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PurePDF Version 2.0

Post by DoubleDutch »

lol
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

small update, PurePDF V2.20 :
- added pdf_GetMultiCellNewLines()
- fixed pdf_Cell() removes newlines and linefeeds at the end of each line
Download :
PurePDF V2.20 (for PB4.5x x86)
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 »

Super! Danke, das sollte meine Probleme beheben.
Translated with http://www.DeepL.com/Translator

Download of PureBasic - Modules
Download of PureBasic - Programs

[Windows 11 x64] [PB V5.7x]
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: PurePDF Version 2.0

Post by MachineCode »

ABBKlaus wrote:small update, PurePDF V2.20
I downloaded this version, but the Help file for it says it's V2.08 still. :)

Also, got a question: I used this code to add a very tall image (5000 pixels high) to a new PDF file, but the image only went on the first page, and not continued over any next pages. How could I do that?

Code: Select all

pdf_Create()
pdf_AddPage()
pdf_Image("1280x5000.png",0,0,200)
pdf_Save("test.pdf")
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
MachineCode
Addict
Addict
Posts: 1482
Joined: Tue Feb 22, 2011 1:16 pm

Re: PurePDF Version 2.0

Post by MachineCode »

Is it possible to open a PDF with this lib and save the doc as plain text back to disk?
Microsoft Visual Basic only lasted 7 short years: 1991 to 1998.
PureBasic: Born in 1998 and still going strong to this very day!
User avatar
Jacobus
User
User
Posts: 88
Joined: Wed Nov 16, 2005 7:51 pm
Location: France
Contact:

Re: PurePDF Version 2.0

Post by Jacobus »

Hi, I just tested this lib and I find it very useful, but I am unable to create a PDF with an RTF file and its formatting. Is this possible? and if yes, how to do that? Thanks.
PureBasicien tu es, PureBasicien tu resteras.
jamirokwai
Enthusiast
Enthusiast
Posts: 772
Joined: Tue May 20, 2008 2:12 am
Location: Cologne, Germany
Contact:

Re: PurePDF Version 2.0

Post by jamirokwai »

Hi ABBKlaus,

any change to have this Lib for Mac OS X also??? :-)

Edit: Please :P
Regards,
JamiroKwai
User avatar
DoubleDutch
Addict
Addict
Posts: 3219
Joined: Thu Aug 07, 2003 7:01 pm
Location: United Kingdom
Contact:

Re: PurePDF Version 2.0

Post by DoubleDutch »

I've tried outputing unicode text using PurePDF and although it writes the ascii characters correctly, the unicode characters out of the normal ascii range are not displayed.

Is this a bug or a known restriction?
https://deluxepixel.com <- My Business website
https://reportcomplete.com <- School end of term reports system
Post Reply