PurePDF Version 2.0

Developed or developing a new product in PureBasic? Tell the world about it.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

Hi IdeasVacuum,

i have no idea how to solve your feature request in an easy way. Maybe you should intercept the linebreak like in Tutorial04 Pagebreak.pb.

Hi Loopingstar,

please have a look at Tutorial07 Images.pb it uses pdf_Addlink() and pdf_SetLink() as you need it. You can also have a look at Tutorial08 Bookmarks.pb which uses Bookmarks as refences for Navigation inside the document.

Regards Klaus
Loopingstar
User
User
Posts: 18
Joined: Tue Oct 01, 2013 12:57 pm

Re: PurePDF Version 2.0

Post by Loopingstar »

Thank you ABBKlaus...
But i don't understand the mechanics...

I have another question : There is not "pdf_Free" or "pdf_Close" ?
Because, when i call two times "pdf_Create", his not kill the last...
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

an adequate command for pdf_close() would be pdf_Save("") without filename nothing is saved on disk ;-)
Loopingstar
User
User
Posts: 18
Joined: Tue Oct 01, 2013 12:57 pm

Re: PurePDF Version 2.0

Post by Loopingstar »

Okay folks, here my solution (thank you IdeasVacuum for idea):

I create my PDF one time (without saving) and i put in a LinkedList the Y position and the Page number of each chapter "title".
Then, i create second PDF and for each chapter number link (in chapter text), i search in my LinkedList the good one...

ABBKlaus, thank you for the tips, but i lost Bookmarks! :(

Here the PDF file with links working http://loopingstar.fr/abc/demo2.pdf
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF Version 2.0

Post by IdeasVacuum »

Hi guys

Oh page breaks are so much fun - not!

Currently, working on a solution where the multi-line cell height is calculated first, then all cells of that row are passed the height.

Edit: Yup, tested a 43-page document, works fine.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Loopingstar
User
User
Posts: 18
Joined: Tue Oct 01, 2013 12:57 pm

Re: PurePDF Version 2.0

Post by Loopingstar »

I solved the problem of bookmarks.
When creating the first pass, I do not create bookmarks. I created bookmarks in the second pass, otherwise it bug.

See PDF with links and bookmarks working http://www.loopingstar.fr/abc/demo3.pdf
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF Version 2.0

Post by IdeasVacuum »

...working very nicely Loopingstar 8)
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Loopingstar
User
User
Posts: 18
Joined: Tue Oct 01, 2013 12:57 pm

Re: PurePDF Version 2.0

Post by Loopingstar »

I have another problem wirth PurePDF 2.08...
When i use pdf_Image(), it does not work with JPEG images.
The file "Tutorial07 Images.pb" dont work in the same manner.
Only PNG file is showing, the last page is blank. TEST > http://loopingstar.fr/abc/Tutorial07%20Images.pdf
Can anyone help me please ?
Loopingstar
User
User
Posts: 18
Joined: Tue Oct 01, 2013 12:57 pm

Re: PurePDF Version 2.0

Post by Loopingstar »

Please, anyone can help me ?
i have Purebasic 5.20 TLS X64 (on Windows Seven Pro 64 bits)

pdf_Image() don't work with JPEG pictures.
I have declared UseJPEGImageDecoder() and UseJPEGImageEncoder() without success


I have another problem wirth PurePDF 2.08...
When i use pdf_Image(), it does not work with JPEG images.
The file "Tutorial07 Images.pb" dont work in the same manner.
Only PNG file is showing, the last page is blank. TEST > http://loopingstar.fr/abc/Tutorial07%20Images.pdf
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF Version 2.0

Post by IdeasVacuum »

Well, personally I only work with PNG images - the quality is superior to JPG for similar file size, especially so if the image has to be re-sized. Why not simply convert your original JPG's to PNG?
irfanview image converter
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
Loopingstar
User
User
Posts: 18
Joined: Tue Oct 01, 2013 12:57 pm

Re: PurePDF Version 2.0

Post by Loopingstar »

Because the PDF is generated on the fly by the user.
And, in the software, is accepted PNG and JPEG images (PNG format is not widely known by users in general)
and they mostly use the JPEG.
ABBKlaus
Addict
Addict
Posts: 1143
Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany

Re: PurePDF Version 2.0

Post by ABBKlaus »

It was a bug !

Code: Select all

      ;Check JPEG / PNG
      Select PeekL(vData\pData) & $FFFFFFFF
Thanks for reporting ;-)

Its fixed now : http://www.purebasicpower.de/?download= ... B52X86.zip
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: PurePDF Version 2.0

Post by IdeasVacuum »

Because the PDF is generated on the fly by the user.
Well, you have a fix now from Klaus 8)
In your code though, you will produce a better PDF using PNG if the image has to be resized. So even if the original image is JPG, your code can internally use PNG before resizing.
PNG format is not widely known by users in general
That used to be true, but it's the defacto web standard now. Practically everyone that uses a computer should be aware of PNG these days - certainly, you could recommend PNG to your Users for best quality.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
StarBootics
Addict
Addict
Posts: 1006
Joined: Sun Jul 07, 2013 11:35 am
Location: Canada

Re: PurePDF Version 2.0

Post by StarBootics »

Hello everyone,

A simple technical question : Is there a limit in size for a picture that can be inserted into a pdf file ?

I ask this because I'm trying to replace a the original logo of 102 X 46 pixel used in the "Tutorial07 Images.pb" by a logo 438 X 200 pixel but it's not working.

Regards
StarBootics
The Stone Age did not end due to a shortage of stones !
Loopingstar
User
User
Posts: 18
Joined: Tue Oct 01, 2013 12:57 pm

Re: PurePDF Version 2.0

Post by Loopingstar »

Thank you for this change, ABBKlaus.
I installed the new version of the lib.

But I found a new bug:

According to my tests, if the size (width, height) of the JPEG image is less than the page size, it works.
But if the size of JPEG image is larger than the page size, the image is not displayed.

This problem does not exist with PNG images.
Post Reply