Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Catalog products PDF reports


alverman

Recommended Posts

I was just wondering why the pages split in the middle of a product table when ... here comes v1.1 to fix the bug :D .

I think this is a great contribution, downlodable pdf documents give that professional touch ....

I'm testing it locally and everything works fine, my only concern is that w/ some 200 products my catalog_4.pdf is more than 500 kb and including images, this is certainly normal.

My questions are: can this create a sort of technical data sheet for the single product "on the fly" and how to give thickness 0 to the cell lines.

 

thanx in advance

 

ivan

Link to comment
Share on other sites

I think this could also be suitable for the checkout_success.php page.

 

Employed with either invoice.php or a customized packing_slip.php file, it would enable a store owner to offer the customer a downloadable and printable version of their order receipt.

 

Any Thoughts?

Link to comment
Share on other sites

Hi!

I installed this contribution in a a developer system, when I tried to make a pdf catalog obtain this response

Warning: getimagesize: Unable to open '..//nueva_lidertel/oscommerce/catalog/images/nokia3210-2.jpg' for reading. in c:inetpubwwwrootnueva_liderteloscommerceadminfpdf.php on line 1418

FPDF error: Missing or incorrect image file: ..//nueva_lidertel/oscommerce/catalog/images/nokia3210-2.jpg

Where is the place to config the path to the catalog images, I think that is bad configurated, but I don't know where is this in the code.

Thanks

Link to comment
Share on other sites

hello! I made a testinstall of the pdf contribution and get a errormessage

 

Warning: fopen("..//osc/images/1212.png","rb") - No such file or directory in /home/ll001vma/www/home/osc/admin/fpdf.php on line 1440

FPDF error: Can't open image file: ..//osc/images/1212.png

 

the 1212.png have all read and executable rights (777) and is already installed in the images directory

 

what shall I do? please help...

 

regards wolkenlos

Link to comment
Share on other sites

Hi all,

I am just experimenting like you all and hope that Gurvan Riou, who made this great contribution, will come to help us;

however I tryed to simulate the errors you get and:

 

.raffles

I get you error when the pic format is not correct, only .png and .jpg are supported.

 

.wolkenlos

I get the same error (or pretty close) when the directory "catalogues" is not set.

In Catalog Directory

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

1 - Make directoy /catalogues. chmod 777 to be able to write pdf files here

I created this directory inside catalog dir, and my admin dir is at the same level of catalog dir under root.

 

.sgflowers

It keeps timing out in the admin when i am generating the catalog

any ideas?

That happens to me too (but not all the times), could it be that your catalog.pdf is too heavy?

 

I tryed to comment out one line in pdf_catalogue.php (at the very bottom ):

 

for ($i=0; $i<sizeof($languages); $i++)

{

$pdf=new PDF();

$pdf->Open();

$pdf->SetDisplayMode("real");

$pdf->AliasNbPages();

if(PRINT_NEW_PRODUCTS)

{

$pdf->NewProducts($languages[$i]['id']);

}

$pdf->CategoriesTree($languages[$i]['id']);

//$pdf->CategoriesListing($languages[$i]['id']);

$pdf->Output("../".DIR_WS_CATALOG."cataloghi/catalog_".$languages[$i]['id'].".pdf",false);

}

and print in pdf format just the CategoriesTree and possible NewProducts, to check if the mod was working properly.

 

.winterradio

I think you are absolutely right. :)

 

Just trying to help

 

ivan

Link to comment
Share on other sites

My thumbnails are in gif with transparent background and i have tihs message when i create a new catalog:

 

FPDF error: Unsupported image file type: gif

 

There is no solution for this? :roll:

 

Thanks for this great contribution :D

Link to comment
Share on other sites

another problem, I modified the others but now I've obtain this reply:

FPDF error: Image file has no extension and no type was specified: /home/lidertel/www/nuevalidertel/catalog/images/

the image file has right properties (It's a jpg file)

some idea?

 

y vuelta la burra al trigo!

Link to comment
Share on other sites

I get a timeout when i try to create the catalog

 

from my server:

 

Max Requests Per Child: 300000 - Keep Alive: on - Max Per Connection: 0

Timeouts Connection: 350 - Keep-Alive: 25

 

 

what settings are needed for osc in general??

Link to comment
Share on other sites

  • 2 weeks later...

I keep getting this error:

 

FPDF error: Missing or incorrect image file: ..//catalog/images/hitman2.jpg

 

The image exists. It's a valid jpg. Is it because the image size is wrong? Is there something in the config I can change?

 

Thanks[/code]

Link to comment
Share on other sites

I have the same problem :?

 

Warning: getimagesize: Unable to open '..//site/catalog/images/littlea.jpg' for reading. in 

e:conceptioneasyphpwwwsiteadminfpdf.php on line 1418

FPDF error: Missing or incorrect image file: ..//site/catalog/images/littlea.jpg

Link to comment
Share on other sites

Has anyone got this working yet.

 

It's a great contribution (if it can be made to work)

Sites at

www.martial-art-shop.com

www.combatgear.co.uk

www.shop-for-gifts.co.uk

www.cbl-drinks.co.uk

www.ye-olde-ferrie-inne.co.uk

www.martialartsnews.co.uk

Link to comment
Share on other sites

  • 3 weeks later...
  • 2 weeks later...
  • 1 month later...

I've successfully used this contrib on www.lifesafety.com

 

In the info box on the left look for the Downloadable Catalog link.

 

It seems to have some difficulty with HTML tables in the descriptions - what can I say, my client likes to use frontpage to mangle, I mean, compose the descriptions.

 

A few notes:

The server I'm on is lightly loaded, and a Ghz+ machine, so making the 1.1 meg PDF took about 10-15 seconds. I'm not performing any image resizing.

 

If you are on a shared server, and they have used your domain name like "lifesafety.com" as part of the path to your filesystem, then the program is going to be very confused if you have products without any pictures. It's the period that creates the problems.

 

My client had many, many gifs. So I FTP all the gifs to my linux box, and run gif2png on the entire directory at once. Uploaded all the .png files. Then I added a line inside the function ShowImage (at line 145)

 

        $path = str_replace('.gif','.png',$path);

and add the line like this:

function ShowImage(&$width,&$height,$link,$path)

{

       $path = str_replace('.gif','.png',$path);



       $width=min($width,MAX_IMAGE_WIDTH);

       $height=min($height,MAX_IMAGE_HEIGHT);

 

The effect is to simply make any filenames with .gif at the end read .png instead. Then the code picks up your png file, and then it's happy.

 

Need to make sure permissions are set to 777 on the catalogues directory, or it can't write the file.

 

The output is rather nice, but like I said, the HTML tables in the descriptions cause it lots of headaches.

 

Tim

Link to comment
Share on other sites

  • 2 months later...

I would love to see some info on how to customize the PDF catalog as far as opening page, table dimensions, and colors. If anyone has info on how to change these things, please post some guidelines.

Link to comment
Share on other sites

ShowImages set to 1, resize set to 0, I get:

FPDF error: Image file has no extension and no type was specified: /homepages/18/d31558121/htdocs/fleva/Zahnarztagentur/shop/images/

 

ShowImages set to 1, resize set also to 1, I get:

FPDF error: Not a PNG file: /homepages/18/d31558121/htdocs/fleva/Zahnarztagentur/shop/catalogues/no_picture.png

 

That's what I get. The shop is MS2, has 2 categories with 2 products in one and 1 product in the other. The categories and the products have the same image-file specified, which is "no_picture.png" and is located in the .../shop/images directory, and it's a valid PNG.

 

I've set up this clean shop just to see if I can get this contrib to work, because on my other shops----I made a mess trying to install and debug this! So far I've been able to make it work only with "show images" set to false.

 

Please, help!

 

Orlin :oops:

Link to comment
Share on other sites

  • 2 months later...

Hi All - I've got this contribution working fairly stable, but not to mike liking. When I "generate catalogue(s)" in the admin section I get a TON of these:

 

Warning: getimagesize(en): failed to open stream: No such file or directory in C:\Apache\Apache2\html\C2R\catalog\admin\pdf_catalogue.php on line 359

 

However, the catalog is created successfully.

 

Does anyone have an idea that can help me out?

 

Ps - I made sure to set the catalog/catalogues directy to read/write.

 

Thanks,

Ryan

Link to comment
Share on other sites

I just got done getting this to work.

 

Here is what I did

 

First, I made copies of *.gif files into *.png files per directions. This gave me two types for each picture.

 

Then in admin/pdf_catalogue.php I made the following changes

 

About line 145 after

function ShowImage(&$width,&$height,$link,$path)
{

 

I added this line so the entry in database would be changed.

 

$path = str_replace('.gif','.png',$path);

 

So when you are all done it should look like this

 

function ShowImage(&$width,&$height,$link,$path)
{
$path = str_replace('.gif','.png',$path);

 

Then on about line 348 I changed

  if(SHOW_IMAGES && strlen($data_array[11]))

 

to this

  if(SHOW_IMAGES && strlen($data_array[12]) > strlen(DIR_FS_CATALOG.DIR_WS_IMAGES))

 

This was the big problem with the script. First it was calling the wrong element in the array and then it was looking for an image when there was none present. If you had images for every product, there would be no problem. If you did not, you would get error file not found

 

Last on line 359 I changed

      $heightwidth=getimagesize($data_array[11]);

 

to

      $heightwidth=getimagesize($data_array[12]);

 

Again it was calling the wrong element of the array. The element in $data_array[11] was for the language which is why you were getting the file named "en" (English).

 

Hope this helps.

Link to comment
Share on other sites

I have installed this mod and i am getting this error repeated loads of times down the page

 

Warning: gzcompress: insufficient memory in /homepages/34/d84309762/htdocs/catalog/admin/fpdf.php on line 1095

 

line 1095 is here

 

//Page content

$p=($this->compress) ? gzcompress($this->pages[$n]) : $this->pages[$n];

$this->_newobj();

$this->_out('<<'.$filter.'/Length '.strlen($p).'>>');

$this->_putstream($p);

$this->_out('endobj');

 

any ideas appreciated as always

 

regards

 

mark

Regards

 

Mark A Reynolds

Link to comment
Share on other sites

  • 3 weeks later...

Hey guys. Trying to get this installed, and I keep getting an error...

Warning: fopen(C:/Inetpub/wwwroot/local/loaded/catalogues/catalog_1.pdf): failed to open stream: No such file or directory in C:\Inetpub\wwwroot\local\loaded\admin\fpdf.php on line 1023

FPDF error: Unable to create output file: C:/Inetpub/wwwroot/local/loaded/catalogues/catalog_1.pdf

 

Can anybody help me out?

 

Thanks,

-Chris

Chris Sullivan

Link to comment
Share on other sites

Anybody?

 

Well, I tried this on both a Windows XP machine running IIS and also a Linux server running Apache. Permissions are set properly....and this just isn't creating the file.

 

It's driving me nuts because the entire code is executing properly, but then at the last stage it's having a problem.

 

Any ideas guys? I really need to figure this one out.

 

Thanks,

-Chris

Chris Sullivan

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...