Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] PDF data-sheet maker v.1.1


alverman

Recommended Posts

Hi,

 

I downloaded the pdf_datasheetmaker on June 14. Except one thing it works fine.

 

The description for the model flows out over the right side. There are only two lines of description. You can not read the whole description.

 

screenshot_datasheet.jpg

 

Any idea?

 

Thanks, Devon

 

www.octopuzz.de

Link to comment
Share on other sites

  • Replies 179
  • Created
  • Last Reply

Top Posters In This Topic

  • 1 month later...

Thanks for the nice hack (sorry for the term but i am a vbulletin owner).

 

When you place your whole shop on a SSL Apache server then you bound to walk into this problem when using your hack.

The pdf opens fine in Moz and Opera but will give you a save as box and on top of that a errorbox withe the message:

 

Internet Explorer cannot download... product_info.php?products_id=... Internet Explorer was not able to open this internet site.

etc...

 

It has to do with a bug in IE (yes again... sigh...).

quoting: andreas at kletsch dot de at this thread: http://nl2.php.net/manual/en/function.sess...che-limiter.php :

The last header is the most important, cause the header "Pragma: nocache"

generated by PHP after calling session_start() is the main problem when using IE and SSL.

The "Pragma: nocache" is only recognized by IE5.x and ONLY used if connection is made over SSL.

Setting it to (not existing) "Pragma: public" overwrites the PHP-generated header, and everything works fine.

 

He is talking about this little addition to fpdf.php in the output() function:

 

function Output($file='',$download=false)

{

//Output PDF to file or browser

global $HTTP_ENV_VARS;



if($this->state<3)

 $this->Close();

if($file=='')

{

 //Send to browser

 Header('Content-Type: application/pdf');

 if(headers_sent())

	 $this->Error('Some data has already been output to browser, can't send PDF file');

 Header('Content-disposition: inline; filename=doc.pdf');

 Header('Content-Length: '.strlen($this->buffer));

 

 Header("Pragma: public"); // <-- hack for SSL-Apache/IE5.x-IE6.x display problem

 

 echo $this->buffer;

}

else

{  ...

 

I hope this helps deperate others...

 

:)

Link to comment
Share on other sites

:oha:

 

Hello John,

 

thanks, i make the changes and it works fine.

 

Reinhold

 

Hi,

 

One question and one remark :D

 

Q: Does anyone upload this contribution with corrections made? It will avoid that others have the same problems ;)

 

R: When you download the PDF at www.chilipper.it everything wents well but... the resulting PDF as the footer wrong. Only to warn the developer :)

 

Best,

 

8) Lopo

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

Thanks for the nice hack (sorry for the term but i am a vbulletin owner)

 

Thank God there is a slight diference between hacker and cracker, so no one should be offended :D :D :wink:

 

Best,

 

8) Lopo

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

I want to replace the "Store title" that figure in the top of the Pdf for a logo in jpg.

 

?Is this possible?

 

Thanks

 

Yes it is... but will require that you recode and test a bit in Header() function in the extended PDF class made for osC ;)

 

At the FPDF site (http://www.fpdf.org) you have a very good tutorial that explains how you can do it.

 

Read more at http://www.fpdf.org/en/tutorial/tuto2.htm

Resulting sample at http://www.fpdf.org/en/tutorial/tuto2.php

 

Hope it helped you.

 

1,

 

 

8) Lopo

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

Q: Does anyone upload this contribution with corrections made? It will avoid that others have the same problems ;)

 

R: When you download the PDF at www.chilipper.it everything wents well but... the resulting PDF as the footer wrong. Only to warn the developer :)

Hi Lopo many thanx for your warning , but www.chilipepper.it/catalog is just a demo cart and I left the footer like that on purpose .

 

As far as your question: you can certainly do it :wink:

 

Ivan

Link to comment
Share on other sites

  • 2 weeks later...

I download the last verison "06/30/2003 - Images in product description".

 

But always show No image, I tryed with .gif, .jpg.

 

What can be?

 

Thanks.

Link to comment
Share on other sites

  • 4 months later...

Hi all ,

 

great contribution , I modified it and wrote a function to display a logo instead of the store name , made it multi language and added protection for the pdf sheet.

 

Note: the protection against modification is for people who have the full Acrobat product.

 

If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if set and different from the user one, can be used to get full access (except with Adobe Reader 6).

 

Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts.

 

e-mail me and I will be glad to share it with you

 

Michael

-------------------

Surf-Timer

Internet Kiosk Software

www.surf-timer.com

Link to comment
Share on other sites

Hi all ,

 

great contribution , I modified it and wrote a function to display a logo instead of the store name , made it multi language and added protection for the pdf sheet.

 

Note: the protection against modification is for people who have the full Acrobat product.

 

If you don't set any password, the document will open as usual. If you set a user password, the PDF viewer will ask for it before displaying the document. The master password, if set and different from the user one, can be used to get full access (except with Adobe Reader 6).

 

Note: protecting a document requires to encrypt it, which increases the processing time a lot. This can cause a PHP time-out in some cases, especially if the document contains images or fonts.

 

e-mail me and I will be glad to share it with you

 

Michael

Could you please upload this to the contribs? I would like to give this update a try...

 

Jas

Link to comment
Share on other sites

  • 2 weeks later...
I will be glad to share it with you

 

Michael

Could you please upload this to the contribs? I would like to give this update a try...

 

Jas

Me too :D

 

You can add it to the same place where PDF data-sheet maker is.

 

Anyway. Post a link to it in here ;)

 

Thanks a lot.

 

B) Lopo

If I helped you, you can help others too.

Search Affero Network. Thanks :)

--

moving mentalities >> fast forward

Link to comment
Share on other sites

  • 4 months later...

My problem: data sheet maker does only display jpg images in the description, no png images. Can anybody help?

 

 

http://beschlag.tischlertipp.de/product_in...p?products_id=2

 

The upper image in the description is a jpg file, the middle one is png, the lower one is jpg.

The pdf does only display the upper and lower image.

 

Thanks,

 

Michael

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...

yes..works very well on MS2. I'm doing a second version of my pdf datasheet to make it compatible with the new fpdf lib version 1.52.

 

I will publish a new version v1.30 of this contribution with all mods for "Options as Images", gif support, company logo, background image, etc.

 

Should be done in a couple of days !

 

Didier.

Link to comment
Share on other sites

After a lot of work (the FPDF library is not the easiest one to use), I just posted version 1.30 of the PDF Datasheet contribution. Due to the size limit for upload of contributions (300K), you must also download another package with various fonts that can be used by PDF Datasheet. You can also find it on the contribution page.

 

Here is the changelog for version 1.30 :

 

- image pdf.gif has been moved to /catalog/images folder

- compatible with latest class FPDF v1.52

- compatible with contribution "Options as Images for MS2"

- includes GIF support

- includes multi-language support for product name, description, etc.

- display of company logo instead of company name (configure in pdf_datasheet_config.php)

- added french language file

- added PDF properties : author, title, subject

- added Verdana font (to activate : see end of pdf_datasheet_functions.php)

- added color for body text

- added color for product name

- added color for special price

- added color for footer text

- model and manufacturer are initialised with "-" if they are emtpy

- fixed problem of line after product description that sometimes is displayed in the image and not underneath

- possibility to align all option values horizontal or vertical (default : horizontal)

- correction for SEARCH_ENGINE_FRIENDLY_URLS

 

Please report here any bugs.

 

Thanks,

 

Didier Debbaut.

Link to comment
Share on other sites

Hello,

 

I've got the same problem on some computers where the PDF does not want to open itself. I think it is linked with the new FPDF class 1.52. I'm trying to figure out what to do. I have already tried some solutions from the forum of FPDF but nothing seems to work.

 

One point to try : drop the line "pragma" in function Output() of fpdf.php. This seems to alter the behavior.

 

I will look into this problem this evening and if needed I will use the previous version of the FDPF function Output() that worked fine !

 

Sorry for this but on my development laptop I didn't have this problem at all. I only saw it at work yesterday ..aaarrrggg.

 

Didier.

Link to comment
Share on other sites

Another way is to force the download of the pdf file. You can obtain this by changing the first line of pdf_datasheet_functions.php.

 

Change $pdf->Output('','I') by

 

$pdf->Output ('your filename.pdf'.'D');

 

This works with gzip compression activated !

 

 

Didier.

Link to comment
Share on other sites

hhhm..did you try to download the file by right-clicking on the link ? this will show you at least if you generate correctly the pdf.

 

As final solution, try to install a previous version (just 2-3 files to change) and tell me if that works. I read that there are some bugs with MSIE (of course) and you must have Adobe Reader installed of course.

 

There is FAQ#3 of www.fpdf.org that explains what to do if you have a blank page. Maybe you can find some information there.

 

Didier.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...