1
Catzwolf
Xoops PDF library Beta Testing
  • 2008/5/12 19:19

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


XoopsPDF Beta Testing:
Version: v.1.0.0
Xoops Version 2.3 (Use latest Alpha)
Purpose: To add PDF support within Xoops.

Hiya Xoops,

This is the first round of beta testing for the new XoopsPDF library. The purpose of this is to ensure complete working within an XOOPS environment, bug mining and feature requests.

This library should NOT be used on a production website and should NOT be used with any other version of XOOPS than stated above.

Install instructions and usage are included within the archive.

Issues:
May not work on multibyte languages. Please let me know if this works or not for you. Will work more closely with DJ on this matter or anyone with a good understand in this area of development.

Yet to do:
Add cache support for PDF. Tried but for a couple of issues with the XoopsCache that prevented me from adding this just yet.

The fpdf library is not supported at the moment. Working on that right and will add full support in the next version.

If you decide to participate with the testing, then please provide information of your working environment details (Apache 2.2 etc etc)

Please download the package from:http://wfprojects.x10hosting.com

So... Let the battle....erm testing begin.

2
hervet
Re: Xoops PDF library Beta Testing
  • 2008/5/13 6:52

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Hello John,

Why haven't you keept this thread ?
https://xoops.org/modules/newbb/viewtopic.php?topic_id=64025&forum=8&post_id=288858#forumpost288858
Thanks for the package, I will test it.

Hervé

** EDIT **
Sorry but the download link seems broken

3
Catzwolf
Re: Xoops PDF library Beta Testing
  • 2008/5/13 15:52

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Hey Herve,

I wanted to keep a both items on topic hence the reason for starting another one. Sorry about that :)

I have fixed the link and it should work now.

Thanks,

Catz

4
hervet
Re: Xoops PDF library Beta Testing
  • 2008/5/14 8:40

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Thanks John

5
Shiva
Re: Xoops PDF library Beta Testing
  • 2008/5/15 7:48

  • Shiva

  • Quite a regular

  • Posts: 280

  • Since: 2006/7/9 1


I would be happy to help too.

6
Catzwolf
Re: Xoops PDF library Beta Testing
  • 2008/5/16 18:35

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


bump:

Any news guys? I might actually comit this to SVN in the next few days. But I am trying to keep the library size down for the sake of the overall package size. It should be easy enough for users yo upload their desired package to the correct pdf library folder? Thoughts on this?

Catz

7
Peekay
Re: Xoops PDF library Beta Testing
  • 2008/5/16 22:05

  • Peekay

  • XOOPS is my life!

  • Posts: 2335

  • Since: 2004/11/20


If you delve deeply into the config files for FPDF in News/SmartSection etc. you'll find it allows customisation of static header elements, e.g. logo, company address etc. This is a great feature.

With some effort you can also generate a dynamic footer (article title, page number etc.).

However, getting WYSIWYG paragraph tags to line up properly when converted to PDF is a royal pain. I also discovered that images placed with relative links using an editor like TinyEditor fail to render to PDF at all.

How does this development relate in comparison to FPDF?
A thread is for life. Not just for Christmas.

8
Catzwolf
Re: Xoops PDF library Beta Testing
  • 2008/5/17 0:46

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


I haven't actually integrated fpdf yet. But I am familiar to its workings; it is very much like ezpdf in many ways.

I must admit that I am not over all impressed with tcpdf, apart from its multi-byte support I would personally use ezpdf for a non multi-byte environment for the reasons you mention.

The problem is that everyone has their own idea how they would like to use these libraries and the methods that I have provided might not be enough. But these are early times and I am sure over the next few months the whole class could change. but if a developer quickly wishes to add content via the methods I have given at the moment, then it should be ample to say the least.

But if a developer wishes to get a little deeper with pdf development, things might have to change and to be honest, I am already thinking of changing a few things now as we speak.

Catz

9
hervet
Re: Xoops PDF library Beta Testing
  • 2008/5/18 11:23

  • hervet

  • Friend of XOOPS

  • Posts: 2267

  • Since: 2003/11/4


Ok, here is my remarks (I know, it's an Alpha version).
There are not criticisms, just remarks.

1/ There are some hard coded strings in the xoopsPDF class
for example in line 88 : trigger_error( 'Library not set' );

2/ In the method setOptions() why are you using variable arguments whereas you can just pass one parameter ?
That's a just a question of curiosity

3/ If I use your example (pdftest.php), I don't have the same render if I just swith from ezpdf to tcpdf.
For example $xoopsPDF->setSlogan uses the slogan that is given to him when you are using ezpdf but it is not used wiht tcpdf
I suppose taht you worked more time on ezPdf than on TPCDF.

4/ As many PDFs will be created from html content, you'll have html entities.
For example, Hervé is converted to Hervé and this is exactly what you see in the PDF.
If you want, I have a function to revert html entities to their original value (adapted to PDF)

5/ In the file xoopspdf.php you are using (line 80) : public function setLibrary()
I'm not sure that the "public" keyword will be recognized by Php 4.
But if you want to go the Php5 way, that's ok for me
I tought that XOOPS 2.3 was compatible with Php 4 ?

6/ function load_library()
May I can suggest to test the value of library (or to set it a default value in the constructor) ?

7/ file pdf.library.php, you use a Php5 constructor

8/ File xoopspdf.php, function setContent()
The function calls pdfStrip() which remove some html tags.
That's ok but some PDF libraries are capable to recognize some html tags.
For example, TPCDF is capable to treat the LI tag

9/ With TCPDF, you can output the PDF to the screen but you can also output it to a local file.
Is it possible to have the same behaviour with the xoopsPDF::render() (or with a property) ?

10/ The version of TCPDF is the one used for Php5

10
Catzwolf
Re: Xoops PDF library Beta Testing
  • 2008/5/22 12:37

  • Catzwolf

  • Home away from home

  • Posts: 1392

  • Since: 2007/9/30


Quote:

hervet wrote:
Ok, here is my remarks (I know, it's an Alpha version).
There are not criticisms, just remarks.


Thanks Herve :)

Quote:

1/ There are some hard coded strings in the xoopsPDF class
for example in line 88 : trigger_error( 'Library not set' );


The stable package will have full Multi-lang support. Just there for testing purposes at the moment.

Quote:

2/ In the method setOptions() why are you using variable arguments whereas you can just pass one parameter ?
That's a just a question of curiosity


Because it is allow you the developer to pass the var as an array, rather than one at a time if you wish.

Quote:

3/ If I use your example (pdftest.php), I don't have the same render if I just swith from ezpdf to tcpdf.
For example $xoopsPDF->setSlogan uses the slogan that is given to him when you are using ezpdf but it is not used wiht tcpdf
I suppose taht you worked more time on ezPdf than on TPCDF.


From what I can see is the mechanics behing the two classes are very different and I had to treat them that way. There is no setslogan() in tcpdf that I could see and if I am wrong please correct me. ezpdf allows you to do this via setslogan() method.

I could add this but the results between the two would be very different.

Quote:

4/ As many PDFs will be created from html content, you'll have html entities.
For example, Hervé is converted to Hervé and this is exactly what you see in the PDF.
If you want, I have a function to revert html entities to their original value (adapted to PDF)


Sorry I missed adding that back in, if adding that code is fine with you then sure.

Quote:

5/ In the file xoopspdf.php you are using (line 80) : public function setLibrary()
I'm not sure that the "public" keyword will be recognized by Php 4.
But if you want to go the Php5 way, that's ok for me
I tought that XOOPS 2.3 was compatible with Php 4 ?


It wont, this class when finished will be a php5 class only.

Quote:

6/ function load_library()
May I can suggest to test the value of library (or to set it a default value in the constructor) ?


good point.

Quote:

7/ file pdf.library.php, you use a Php5 constructor


Quote:

8/ File xoopspdf.php, function setContent()
The function calls pdfStrip() which remove some html tags.
That's ok but some PDF libraries are capable to recognize some html tags.
For example, TPCDF is capable to treat the LI tag


The problem is that not all libraries do though, so i thought it would be better and easier to do it this way. If you would like a different approach to this, please let me know.

Quote:

9/ With TCPDF, you can output the PDF to the screen but you can also output it to a local file.
Is it possible to have the same behaviour with the xoopsPDF::render() (or with a property) ?


Yes, the version I created for wf-Channel cached rendered pdf files and I plan on doing the same here.

Quote:

10/ The version of TCPDF is the one used for Php5


lol this library will only be for php5. Sorry but php4 is no longer supported by php.net and it is time no move on (Php6 is just about around the corner :p )

If you have anything you would like to add to this class Herve, or anyone else, please feel free to make them and send them to me or send them as a patch via sourceforge.

Catz

Login

Who's Online

428 user(s) are online (336 user(s) are browsing Support Forums)


Members: 0


Guests: 428


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits