Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PDF Catalog v.1.5


Recommended Posts

  • Replies 504
  • Created
  • Last Reply

Top Posters In This Topic

Ok Fair enough, but what about the second part of the error logo.jpg is not a jpeg????? looks like a jpeg to me.

 

;)

 

never mind once I removed the images which were in subfolders the catalog generated as expected.

 

Thanks for the pointer - Bit of a noob to php so I'm kinda feeling my way in the dark with this stuff.

Link to comment
Share on other sites

I'm sorry but this is just a part of the original PDF programme. Every time it encounters something it can't do it throws up an error file which often has nothing to do with what the problem really is.

 

One user was getting the error that it could not resize the image because it didn't exist. The image existed alright, but the problem was that it was the same size or smaller than the minimum image size in the osC admin panel and so it couldn't be thumbnailed. The programmes response was to say it didn't exist.

 

In another part of the programme it reads as though it is supposed to place a default image (no-image) when a product does not have an image, but this is actually an error code and will stop the whole process in its tracks. I tested a mod that was supposed to cure this but the mod didn't work either.

 

I really would like to clean up this programme, but getting the time is the problem. At the moment I'm working on trying to get it to create mirror sub-folders to match those in the main images folder to get around the problem of having to keep all images in the main images folder - but it's not going too well.

 

Vger

Link to comment
Share on other sites

Glad you got it working okay.  Would be nice to get some feedback on the time (roughly, in seconds) it took to generate the Thumbnail PDF Catalogue and what the file size is.

 

Vger

 

sorry i am using the origonal contrib, but I am going to try the thumbnail on because the origional one takes 15 minutes to process the file (mind you there is 1500 products).hopefully the thumbnail version wont take so long.

 

Also with the original one i get an error when i open or print the pdf saying "insufficient data for an image" and then some of the images are there and others aren't, any ideas????

Link to comment
Share on other sites

Ok now when I try to use the thumbnail version I get:

 

Missing or incorrect image file: /home/www/public_html/catalog/images/imagecache/USPCH.jpgFPDF error: Not a JPEG file: /home/www/public_html/catalog/images/logo.jpg

 

the directory has full access enabled, all images are under catalog/images (no sub folders)

 

no userfull error generated in server logs.

 

Any Ideas?????

Link to comment
Share on other sites

Ok, I have reverted back to the original version for the moment.

 

There appears to be something wrong with the jpeg processing code (couldn't tell you where as I dont understand what it does yet), I noticed that all the products with jpeg images have no images in the pdf whereas the ones which have gif images work fine.

 

?????????

Link to comment
Share on other sites

Ok, I have reverted back to the original version for the moment.

 

There appears to be something wrong with the jpeg processing code (couldn't tell you where as I dont understand what? it does yet), I noticed that all the products with jpeg images have no images in the pdf whereas the ones which have gif images work fine.

 

?????????

 

 

Ok thanks to "da-Idiot" and "TooLoo" i have a solution to the jpeg issue:

 

in pdf_catalog.php line 173 shoould read:

 

$destination=DIR_FS_CATALOG."catalogues/";

 

not

 

$destination =DIR_FS_CATALOG."catalogues/";

 

And in pdf_fpdf.php lines 1476 to 1481 should be:

 

	if(!$a){
?
?print('Missing or incorrect image file: '.$file);
?$file=DIR_FS_CATALOG.DIR_WS_IMAGES.DEFAULT_IMAGE;
?//$this->Error('Missing or incorrect image file: '.$file);
?}

 

not

 

	if(!$a)
?
?print('Missing or incorrect image file: '.$file);
?$file=DIR_FS_CATALOG.DIR_WS_IMAGES.DEFAULT_IMAGE;
?//$this->Error('Missing or incorrect image file: '.$file);
?

 

NOTE: there are missing {}'s

 

Still cant get the thumbnail version going though.

 

this would help as my pdf sits at 30mb and take about 1/2 hour to generate (not the fastest server though - its for testing)

 

Thanks in advance.

Edited by computerFreek
Link to comment
Share on other sites

For anyone wondering this is how you can output the data from the products_extra_fields contribution to the pdf file.

 

Note: I am new to php so bear that in mind.

 

Firstly add the following to pdf_catalog.php (I added it at line 426 so it would apear under the model):

 

 ?//include product_extra_fields
?if(SHOW_PRODUCTS_EXTRA_FIELDS)
?{
?$extra_fields_query = tep_db_query("
?SELECT pef.products_extra_fields_name as name, ptf.products_extra_fields_value as value
?FROM ". TABLE_PRODUCTS_EXTRA_FIELDS ." pef
?LEFT JOIN ?". TABLE_PRODUCTS_TO_PRODUCTS_EXTRA_FIELDS ." ptf
?ON ptf.products_extra_fields_id=pef.products_extra_fields_id
?WHERE ptf.products_id=".$data_array[10]."
?ORDER BY products_extra_fields_order");
?while ($extra_fields = tep_db_fetch_array($extra_fields_query)) {
?	if ($extra_fields['value'] != '') {
? ?$line=$extra_fields['name'].": ?".$extra_fields['value'];
? ?$this->Cell($data_array[0]+6,5,"",0,0);
? ?	$this->MultiCell($this->text_fw,5,$line,PRODUCTS_BORDER,'L');
?	}
?}
?}

 

Then In you pdf_config.php file add the following just before the ?>(this allows you to turn this on and off):

 

	//Show the Product extra fields if you have this module installed (0 = no, 1 = yes)
//It can be downloaded from http://www.oscommerce.com/community/contributions,2202
define('SHOW_PRODUCTS_EXTRA_FIELDS',1);

 

If anyone has a better way or any suggestions please feel free to comment.

 

This is just my way of giving something back to the community.

 

PS: Should I add this as a contrib, and if so where??

Edited by computerFreek
Link to comment
Share on other sites

Just to make the point that those are errors in the original PDF Catalog, and are not present in the Thumbnail version. There's also a reference to DIR_S_CATALOG in the original which should have been DIR_FS_CATALOG.

 

As for your amendment you can post that as a seperate file to the original contribution if you wish. I am happy to incorporate it as an optional add-on to the Read Me First file for the Thumbnail PDF Catalog, with credit to yourself if you wish.

 

I don't know why you can't get this (Thumbnail PDF Catalogue) working. I have already had reports back from others who have installed it and have it working.

 

Vger

Ok thanks to "da-Idiot" and "TooLoo" i have a solution to the jpeg issue:

 

in pdf_catalog.php line 173 shoould read:

 

$destination=DIR_FS_CATALOG."catalogues/";

 

not

 

$destination =DIR_FS_CATALOG."catalogues/";

 

And in pdf_fpdf.php lines 1476 to 1481 should be:

 

	if(!$a){
?
?print('Missing or incorrect image file: '.$file);
?$file=DIR_FS_CATALOG.DIR_WS_IMAGES.DEFAULT_IMAGE;
?//$this->Error('Missing or incorrect image file: '.$file);
?}

 

not

 

	if(!$a)
?
?print('Missing or incorrect image file: '.$file);
?$file=DIR_FS_CATALOG.DIR_WS_IMAGES.DEFAULT_IMAGE;
?//$this->Error('Missing or incorrect image file: '.$file);
?

 

NOTE: there are missing {}'s

 

Still cant get the thumbnail version going though.

 

this would help as my pdf sits at 30mb and take about 1/2 hour to generate (not the fastest server though - its for testing)

 

Thanks in advance.

Link to comment
Share on other sites

The products_extra_fields code has been added as an optional file to the Thumbnail PDF Catalogue (under your name). Thanks for the input!

 

By the way, to avoid confusion with the original contribution, I have started a support thread for the Thumbnail PDF Catalogue at:

http://www.oscommerce.com/forums/index.php?showtopic=164600

 

Vger

Link to comment
Share on other sites

Glad you got it working okay.  Would be nice to get some feedback on the time (roughly, in seconds) it took to generate the Thumbnail PDF Catalogue and what the file size is.

 

Vger

 

 

Hi, got the contribution working fine, on a 700 item catalog it was 13 seconds generating and produced a 1.94MB size file. Would probably be faster and smaller if I could figure out how to get it to list more then 4 products per page, or if there was a wayto get 2 columns per page.

 

Great work Vger!!!!

Link to comment
Share on other sites

I'm glad it's working out for you Wayne. I've started a new thread for this now, as it's a bit confusing for the people just using the original PDF Catalog contribution to come here and find all of this thread. The new support thread is here:

http://www.oscommerce.com/forums/index.php?showtopic=164600

 

Vger

Link to comment
Share on other sites

  • 1 month later...

Hello

 

thanks Vger,

 

it was that ;),

but now if I resize image I have this message:

Warning: imagecreate(): Invalid image dimensions in d:\web\www\admin\pdf_catalogue.php on line 187

Warning: imagecopyresized(): supplied argument is not a valid Image resource in d:\web\www\admin\pdf_catalogue.php on line 188

Warning: imagejpeg(): supplied argument is not a valid Image resource in d:\web\www\admin\pdf_catalogue.php on line 193

 

If I put to 0 (no resize) it turns turns etc... and nothing happen, i must do ctrl alt sup to shut down application

Link to comment
Share on other sites

thanks for your help

 

You mean that the size of images in pdf_config.php:

//Width max in mm     
define('MAX_IMAGE_WIDTH',105);
//Height max in mm          
define('MAX_IMAGE_HEIGHT', '');

 

must be bigger than size image in osCommerce amdin panel, Configuration --> Images

in my case it's width 100 height 80

 

thanks

Link to comment
Share on other sites

No, I mean that none of your product images must be smaller in size than the small image width or height in your osC admin panel under 'Images'. If even one of your product images is smaller than the small image width or height then the process will fail.

 

Vger

Link to comment
Share on other sites

hello,

 

I had images smaller than small image definition in oscommerce admin, I fixed it but I have always the same message

Warning: imagecreate(): Invalid image dimensions in d:\web\www\admin\pdf_catalogue.php on line 187

Warning: imagecopyresized(): supplied argument is not a valid Image resource in d:\web\www\admin\pdf_catalogue.php on line 188

Warning: imagejpeg(): supplied argument is not a valid Image resource in d:\web\www\admin\pdf_catalogue.php on line 193

 

all my images are in jpg dimension 100 x 80 idem in oscommerce admin

 

I don't understand...

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