alverman Posted February 1, 2003 Author Share Posted February 1, 2003 Hi all I think I needed some sleep (7.00 a.m here) . hellbound: Now all its OK for me! I'glad it works now and like your centered lay-out better :wink: , I see you are having trouble w/ the Nutritional Data spanning on different pages, I'm not sure I can help you much on that, just try playing w/ the settings, sorry :). jchasick: its writing the file as type .php instead of .pdf do you mean you are viewing something like: http://www.yoursite.com/catalog/pdf_datash...?products_id=33 in place of: http://www.yoursite.com/catalog/pdf_datasheet.pdf if so, it's because the content is printed directly to the browser and not created on server and then downloaded, doesn't it open up AcrobatReader ? If you see the document you can save it as .pdf. I hope I did not misunderstood. thank you ivan Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 no, when i click on the create pdf button ( link shows as mysite.com/catalog/pdf_datasheet.php?products_id=288), it creates a file on the desktop labeled pdf_datasheet.php Quote Link to comment Share on other sites More sharing options...
alverman Posted February 1, 2003 Author Share Posted February 1, 2003 My best guess is some setting in your browser, but this does not help much. Same thing here? http://www.chilipepper.it/catalog/product_...?products_id=47 Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 yes, i get the same result clicking on your link this is strange.... Quote Link to comment Share on other sites More sharing options...
alverman Posted February 1, 2003 Author Share Posted February 1, 2003 I made the fix you posted and now the file is being created, except it is being created with the extension .php instead of .pdf what happened before the fix ? are you on IE , Netscape ? Just trying to figure it out. Quote Link to comment Share on other sites More sharing options...
Guest Posted February 1, 2003 Share Posted February 1, 2003 sorry for not supplying detailed info to start with..... was getting the image error before applying the fix testing this locally on my OS X server have tested with the following browsers: IE, Safari, Mozilla, Omniweb Quote Link to comment Share on other sites More sharing options...
khaaliq Posted February 2, 2003 Share Posted February 2, 2003 Did I miss it or did anyone get this mod to work with .gifs? I get this error FPDF error: Unsupported image file type: gif Also, the information at the bottom of the pdf pages does not show my email and business address. Can someone help me out with this? Thanks. Quote Link to comment Share on other sites More sharing options...
alverman Posted February 2, 2003 Author Share Posted February 2, 2003 I'm afraid to tell you that at the moment and w/the library that this mod. uses it is not possible to parse .gif images to embed them into PDF, only .png and .jpg are supported (this is what the readme.txt says). Just a note: for picture-like images I would suggest .jpg format, it is a much better solution in terms of compression and overall result. ivan Quote Link to comment Share on other sites More sharing options...
CC Posted February 2, 2003 Share Posted February 2, 2003 I have set up a new image input in admin for PDF Image. This way we have small image, large image and PDF Image for all our products. This seems to work nicely. We always use gifs so we can keep the small image transparent for the site, they just look much neater on the site that way. To show your email and business addres go to the text file in English, or whatever your language is, and change it there. CC. Quote Link to comment Share on other sites More sharing options...
alverman Posted February 2, 2003 Author Share Posted February 2, 2003 I've probably underestimated the massive use of gifs as SMALL_IMAGE. If find much easier to optimize jpg format in Photoshop but that's another story. I think that if you really want to use this mod and not having to face problems w/ pics formats, your solution can be the best, just a little additional work to set the new db field and create the new supported pics. ivan Quote Link to comment Share on other sites More sharing options...
khaaliq Posted February 2, 2003 Share Posted February 2, 2003 Will do. Thanks everyone! Quote Link to comment Share on other sites More sharing options...
orienell Posted February 2, 2003 Share Posted February 2, 2003 Does anyone have the updated files they are willing to share? Or better yet is there going to be an update to the package soon? Quote Link to comment Share on other sites More sharing options...
alverman Posted February 3, 2003 Author Share Posted February 3, 2003 Hi all, not my businness but ... In some sites using this mod I've seen : IncVAT price and exVAT price show same amount eg.: Price/Special price : $ 100.00 inc VAT ($100.00 ex VAT), I guess because of "define('DISPLAY_PRICE_WITH_TAX', false);", correct ? If you are not happy w/ that :evil: try replacing lines 329 ? 337 with: if ($print_catalog = tep_db_fetch_array($print_catalog_query)){ if(DISPLAY_PRICE_WITH_TAX != false){ if ($new_price = tep_get_products_special_price($print_catalog['products_id'])) { $special_price = TEXT_PRODUCTS_SPECIALS_PRICE . $currencies->display_price($new_price, tep_get_tax_rate($print_catalog['products_tax_class_id'])) . TEXT_PRICE_VAT_INCLUDED . ' (' . $currencies->display_price($new_price, tep_get_tax_rate('')) . TEXT_PRICE_EX_VAT . ')'; $products_price = TEXT_PRODUCTS_PRICE . $currencies->display_price($print_catalog['products_price'], tep_get_tax_rate($print_catalog['products_tax_class_id'])) . TEXT_PRICE_VAT_INCLUDED; } else { $products_price = TEXT_PRODUCTS_PRICE . $currencies->display_price($print_catalog['products_price'], tep_get_tax_rate($print_catalog['products_tax_class_id'])) . TEXT_PRICE_VAT_INCLUDED . ' (' . $currencies->display_price($print_catalog['products_price'], '') . TEXT_PRICE_EX_VAT . ')'; } } else { if ($new_price = tep_get_products_special_price($print_catalog['products_id'])) { $special_price = TEXT_PRODUCTS_SPECIALS_PRICE . $currencies->display_price($new_price, '') . TEXT_PRICE_EX_VAT; $products_price = TEXT_PRODUCTS_PRICE . $currencies->display_price($print_catalog['products_price'], '') . TEXT_PRICE_EX_VAT; } else { $products_price = TEXT_PRODUCTS_PRICE . $currencies->display_price($print_catalog['products_price'], '') . TEXT_PRICE_EX_VAT; } } If this works for yous guys I can include it in the update (which, before you ask, will still NOT support GIFs 8) ). ivan Quote Link to comment Share on other sites More sharing options...
orienell Posted February 3, 2003 Share Posted February 3, 2003 I'd just like a copy of the first version to work. I can change gifs to jpgs. I tryed walking through the changes posted here and just got a headache. :( Quote Link to comment Share on other sites More sharing options...
mikimoto Posted February 4, 2003 Share Posted February 4, 2003 If you read the first pages of this post, you see that i had the same problem, but i solved it changing 4 lines of code. This is using Medium or Big images (i have it in jpg, but smalls in gif). Good luck :roll: Quote Link to comment Share on other sites More sharing options...
orienell Posted February 5, 2003 Share Posted February 5, 2003 I now have it mostly working with thanks to Ivan sending his changes. I now only have a problem with images which I hope to look at this evening. For now I just turned images off in the config file. With images on I get an error like this: Warning: getimagesize: Unable to open '/catalog/images/CN0041.jpg' for reading. in /var/www/html/catalog/pdf/fpdf.php on line 1418 FPDF error: Missing or incorrect image file: /catalog/images/CN0041.jpg The image is .jpg and in the correct place. I'll let eveyone know when I find the problem. Thanks Quote Link to comment Share on other sites More sharing options...
orienell Posted February 5, 2003 Share Posted February 5, 2003 I've also discovered that the pdf generator does not observe the html formatting that the page may be using. Has anyone else noticed this? See my site for an example of what I mean. http://www.5thelement.com/catalog/product_...products_id=211 Thanks Quote Link to comment Share on other sites More sharing options...
alverman Posted February 5, 2003 Author Share Posted February 5, 2003 Unfortunately yes Orienell, In the code you see: $description = str_replace(" ","",rtrim(strip_tags($print...... on line 369 to avoid at least instead of space. but $description = str_replace(" "," ",rtrim(strip_tags($print...... should do better. Sorry about keeping patching the code. strip_tags removes HTML and PHP tags, but when pdf is printed, HTML tags are not visible but they are still there giving unwanted empty lines. If you have a <table><tr><td>text..... formatting in your description, try removing the strip_tags function to see what I mean. Do not know how to fix this (..still trying). Ivan Quote Link to comment Share on other sites More sharing options...
Guest Posted February 11, 2003 Share Posted February 11, 2003 Does anyone know how to adjust the margins in this fine contribution? I've hacked around, but with no luck. My description is running past the left side margin. I need to move the whole description right a few inches. I didn't see an easy way of doing this. Hopefully, I missed something. Quote Link to comment Share on other sites More sharing options...
Commie Posted February 11, 2003 Share Posted February 11, 2003 FPDF error:Missing or incorrect image file: /catalog/images/CN0041.jpg I have the exact same problem but not with the datasheet maker but with the pdf catalog. BTW, excellent contribution. The datasheet works perfectly but the catalog (at least for me) does not :( Quote Link to comment Share on other sites More sharing options...
rdavido Posted February 11, 2003 Share Posted February 11, 2003 FPDF error:Missing or incorrect image file: /catalog/images/CN0041.jpg The path looks wrong: are you sure that your images are in /catalog/images in the root system directory? For Microsoft folks, that's the same as saying your directory is C:/catalog/images/. That would be really odd for a virtual domain setup. It should be more something like /var/www/html/catalog/images/ or /home/domains/hipware.com/images/ as the absolute path to the images directory. You might get away with dropping the "/" in the path, which would leave you with the relative path catalog/images If you are using linux or unix in your virtual hosting environment, you can login to a shell and type "pwd" and it will tell you the path you are in or ask your system administrator. If the path is correct (which I doubt), have either of you checked the permissions to see if the application has read permission on the images? It may also require more liberal permissions to incorporate or alter the images. Just a guess based on what you've reported, hope it helps. Quote *edit* Link to comment Share on other sites More sharing options...
Commie Posted February 11, 2003 Share Posted February 11, 2003 ^^It's probably a typo. I get the same error but the output looks like this: ..//catalog/etc... not /catalog/etc... Quote Link to comment Share on other sites More sharing options...
alverman Posted February 11, 2003 Author Share Posted February 11, 2003 We talking about PDF datasheet, aren't we? To mod page margins: in catalog/pdf/fpdf.php line 173 //Page margins (2 cm) $margin=56.70/$this->k; U can bring it back to 28.35 (1 cm) as it is in PDF catalog. HTH ivan Quote Link to comment Share on other sites More sharing options...
rdavido Posted February 12, 2003 Share Posted February 12, 2003 ^^It's probably a typo. I get the same error but the output looks like this: His post looks like a straight cut and paste, so that might be his problem. Could you reply with the exact error you are receiving without editing it? If you don't want to reveal your directory structure to the world at large then just IM it to me. Did you try changing the permissions on the files? If it can't read them it might reply with this error. You could try to see what the conditions are for it to spew out this particular error by searching for the error text in the application itself. It may be poor error handling in the application leading you in the wrong direction. Quote *edit* Link to comment Share on other sites More sharing options...
Guest Posted May 9, 2003 Share Posted May 9, 2003 Hi, I'm using 2.2-CVS Daily Snapshot (05/08/2003) and when I change product_info.php like instructed in contrib file quote; 2.2 CSV add: <?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info_values['products_id']) .'" target="_self">' . tep_image('pdf/pdf.gif') .'</a>'; ?> it shows blank pdf I erased values so now it looks like this; <?php echo '<a href="' . tep_href_link(FILENAME_PDF_DATASHEET, 'products_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('pdf/pdf.gif') .'</a>'; ?> and it works Regards Damir Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.