Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Addon] PDF Datasheet


kymation

Recommended Posts

This addon creates a PDF document containing the information found on each of your osCommerce product pages. This allows your customer to save or print a nice-looking catalog page for each of your products.

 

Unlike other PDF generators, this one is designed to use Unicode fonts. This means it will render pages correctly from osCommerce 2.3 and later versions. It can also render basic HTML used in your product descriptions, which was a problem with older versions.

 

It's also designed to work with the module system that was introduced with osC 2.3, so you can easily change the fonts, images, layout, etc. from your store's Admin panel. The release version ships with a basic set of modules that can emulate the stock Product Info page. More modules are planned to add more data and make it easier to restyle the page. A sample page is included with the distribution files.

 

While we are waiting for a moderator to approve the upload, the distribution package is available from my site.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

One thing I left out of the instructions: the ext/tcpdf/cache/ directory needs to be writable. Set the permissions to the same as your images/ directory.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 3 weeks later...

Hi, I was wondering if you could help me correct the errors I'm having with this Add-on. I got it to work once then lost part of my site overall when I corrected that and got the site working properly I then tested the link for the PDF Datasheet and got the following errors:

 

Notice: Use of undefined constant MODULE_PDF_DATASHEET_TEMPLATE_TITLE - assumed 'MODULE_PDF_DATASHEET_TEMPLATE_TITLE' in /home/gtecht5/public_html/products/includes/modules/pdf_datasheet/pd_template.php on line 23

 

Notice: Use of undefined constant MODULE_PDF_DATASHEET_TEMPLATE_DESCRIPTION - assumed 'MODULE_PDF_DATASHEET_TEMPLATE_DESCRIPTION' in /home/gtecht5/public_html/products/includes/modules/pdf_datasheet/pd_template.php on line 24

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21469

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22568

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22570

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 21838

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22559

 

Notice: Undefined offset: 0 in /home/gtecht5/public_html/products/ext/tcpdf/tcpdf.php on line 22264

TCPDF ERROR: Wrong page number on setPage() function: 0

 

 

 

Is there something I can do to see this part of the code? When I download the page, (tcpdf.php I'm only able to see 79 Lines and the 80th line is just a name. After that nothing shows.

Link to comment
Share on other sites

That's caused by a file that should have been in the Extras directory. Find catalog/includes/modules/pdf_datasheet/pd_template.php and delete it.

 

The TCPDF library file is over 28,000 lines long. That requires a good editor just to open the file. I know that Eclipse will open it, but I had to increase the memory allocation just to get it to run. I haven't tried other editors.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

That's caused by a file that should have been in the Extras directory. Find catalog/includes/modules/pdf_datasheet/pd_template.php and delete it.

 

The TCPDF library file is over 28,000 lines long. That requires a good editor just to open the file. I know that Eclipse will open it, but I had to increase the memory allocation just to get it to run. I haven't tried other editors.

 

Regards

Jim

 

 

 

Hi Jim!

 

Good news. I was able to get to work without the deletion or the debugging of the tcpdf file. I found the root cause of the error in pdf_template.php near the bottom of that code it allows you to enable or disable the line that causes this error. I just changed it from "true" to "false" and now my datasheet works. I'm stuck with trying to format it correctly now and allow the layout to display the way I want it. Once I have that working I'll post that code here as well. It may help those who are having similar issues as I had.

 

Thank you again!

Link to comment
Share on other sites

I have made some changes to the files as well. There are issues with spacing in some of the modules. Unfortunately the TCPDF library is poorly documented and very complex, so it's hard to work with. I have also written some more modules. I just need to find time to finish them up and prepare a release.

 

Post here if there's something you can't figure out and I'll try to help.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hi Jim! One more fix I found that makes my module work. It may help others as well.

 

In the file "catalog/ext/tcpdf/config/tcpdf_config.php" Around line 235 (which is where it is for me. Maybe different for other users).

 

The following exist: define('K_TCPDF_CALLS_IN_HTML', true);

 

If you change it to: define('K_TCPDF_CALLS_IN_HTML', false);

 

This may help your PDF datasheet work without calling or looking for your HTML and causes the mdule to create the HTML on its own. This worked for me. I am now poised with changing the header image and text to get everything to fit properly and layout correctly. If you know of something that will help me in this I'd greatly apprecite it.

 

An example of my module and how it is working currently can be seen by following this URL.: www.gtecht.com/products. Any of the products you see listed, once you click on them for product info has a link that will generate the PDF Datasheet

 

I need to right justify the text in the header and even though I've resized my logo it is still being displayed with the same size as it is seen here. I've also tried several different changes in the margins of the Header and Top in the same file listed above, but it still seems to display the same way. The data on the PDF Datasheet and the product image have no issues. Just the header.

 

If anyone can assist me on changing this part I'd be eternally grateful.

 

Also, I installed the following in the Admin part of osCommerce, there are 9 Modules that come with this addon but I only installed 5 of them and this works for me. It may differ for others depending on what you wish to use.

 

PDF Datasheet Addon:

 

Modules & Sort Order

 

Description - 9050

Fonts *REQUIRED* - 9002

Header - 9001

Initialize - 9000

Title - 9010

 

These are the only ones I've used and using this creates the datasheet for me.

 

I hope this helps.

 

Kind Regards,

Link to comment
Share on other sites

To change the size of the Header image, change the Image Multiplier in the Header module.

 

I'm not sure about right justifying the text. You should probably look at the Header method in the TCPDF class. It might be necessary to change the TCPDF code to make that happen.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 1 month later...

Hello Jim,

Yesterday I downloaded the pdf I installed without problems. I see the icon on the product properly but when I click it I get this result:

 

Notice: Use of undefined constant MAX_MANUFACTURERS_EXTRA_LIST - assumed 'MAX_MANUFACTURERS_EXTRA_LIST' in D:\inetpub\webs\.\.\includes\modules\boxes\bm_manufacturers_extra.php on line 56

 

Notice: Use of undefined constant MAX_MANUFACTURERS_EXTRA_LIST - assumed 'MAX_MANUFACTURERS_EXTRA_LIST' in D:\inetpub\webs\.\.\includes\modules\boxes\bm_manufacturers_extra.php on line 67

TCPDF ERROR: Some data has already been output, can't send PDF file

 

Can you help me? Thanks in advance.

Link to comment
Share on other sites

The constant MAX_MANUFACTURERS_EXTRA_LIST is not used anywherin the PDF datasheet, and the file \includes\modules\boxes\bm_manufacturers_extra.php is also not a part of this Addon. Your error is due to some other Addon that you have installed which you apparently did not install correctly.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

Hello Jim,

I solved the problem by removing the box "manufacturers" and "manufacturers extra" from admin.

Now everything is working properly.

I do not know if this can affect the proper collation of data to generate the pdf file.

I hope you help.

Enrico.

Link to comment
Share on other sites

My store is has a lot of addons and I think they are correctly installed.

I always follows the attached installations instructions and most of them is well documented like the Featured Products etc.

 

When i open PDF_DATASHEET.PDF I get a lot of errors:

 

Notice: Constant TABLE_CUSTOMERS_GROUPS already defined in C:\wamp\www\mss_006\includes\database_tables.php on line 102
Notice: Constant MAX_DISPLAY_FEATURED_PRODUCTS already defined in C:\wamp\www\mss_006\pdf_datasheet.php on line 67
Notice: Constant DOCUMENTS_SHOW_PRODUCT_INFO already defined in C:\wamp\www\mss_006\pdf_datasheet.php on line 67
Notice: Constant MODULE_BOXES_WHATS_NEW_TITLE already defined in C:\wamp\www\mss_006\includes\languages\english\modules\boxes\bm_shop_by_price.php on line 13
Notice: Constant MODULE_BOXES_WHATS_NEW_DESCRIPTION already defined in C:\wamp\www\mss_006\includes\languages\english\modules\boxes\bm_shop_by_price.php on line 14
Notice: Constant MODULE_BOXES_WHATS_NEW_BOX_TITLE already defined in C:\wamp\www\mss_006\includes\languages\english\modules\boxes\bm_shop_by_price.php on line 15
Notice: Use of undefined constant MODULE_BOXES_SHOP_BY_PRICE - assumed 'MODULE_BOXES_SHOP_BY_PRICE' in C:\wamp\www\mss_006\includes\modules\boxes\bm_shop_by_price.php on line 26
Notice: Use of undefined constant MODULE_BOXES_SHOP_BY_PRICE_DESCRIPTION - assumed 'MODULE_BOXES_SHOP_BY_PRICE_DESCRIPTION' in C:\wamp\www\mss_006\includes\modules\boxes\bm_shop_by_price.php on line 27
Notice: Use of undefined constant HEADER_MENU_TITLE_CATEGORIES - assumed 'HEADER_MENU_TITLE_CATEGORIES' in C:\wamp\www\mss_006\includes\modules\header_footer_contents\hfc_menu.php on line 168

 

Do you have any idea of why pdf_datasheet.php is calling this modules? How can I remove them from pdf_datasheet?

The fix above just to remove them isnt working becuase i still want to have the possibility to use them om my store.

Link to comment
Share on other sites

Those errors have nothing to do with the PDF Datasheet. They are caused by other problems in yoru store. You need to fix those problems.

 

Any line that tells you that a constant is already defined means you have added that define twice (or more.) Remove all but the first one. Any line that tells you that some constant is not defined means that you did not add that define. Do so.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

The module exists, I just haven't had the time to do another release. Which I'm working on right now. If you can't wait, let me know here and I'll put up a quick update package (no instructions.)

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

The package is here. The instructions have not been updated. Also, most of the existing modules have minor changes. The changes are mostly to handle spacing between modules. If you use any of those new modules, uninstall the old module before you upload the new one.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I just installed the package. (fist I uninstalled and deleted the old modules)

 

The PDF looks great, the new spacing made the layout look much better.

 

I just have a small problem with the specification-module.

It dosent shows up on the PDF.

I can see all the specifications on product_info.php but not on the generated PDF.

 

To install it I guess it just was to upload the file and enable it in admin.

 

The settings for the module is:

 

Enable the Module

True

 

Sort Order

9090

 

Padding

2

 

Indent Table

6

 

English Heading

Specifications

 

 

If I change the sort order to 9010 I can see a new empty space, so I guess to module is placed on the PDF but with no data.

 

Do I need to make some changes in admin/product_specification.php aswell?

Link to comment
Share on other sites

That module should just work. It has where I've used it, and the copy you have is the exact same code. I have no idea why it's not working for you.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I guess it dosent have anything to do with the Image Price module?

Becuase that was the only module that didnt worked for me, (im missing price_in_cart_only in my sql)

Link to comment
Share on other sites

No, the Specifications module pulls the specifications based on the products_id. It doesn't depend on any other module. It does also depend on $current_category_id and $languages_id, but those should always be set. I've been looking at the code, and I still don't see the problem.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

I get the current_category_id and language_id

specification_query_raw:

select ps.specification, s.filter_display, s.enter_values, sd.specification_name, sd.specification_prefix, sd.specification_suffix from products_specifications ps join specification_description sd on (ps.specifications_id = sd.specifications_id) join specifications s on (sd.specifications_id = s.specifications_id) join specification_groups sg on (sg.specification_group_id = s.specification_group_id) join specification_groups_to_categories sg2c on (sg2c.specification_group_id = sg.specification_group_id) where sg.show_products = 'True' and s.show_products = 'True' and sg2c.categories_id = '18' and ps.products_id = '1' and sd.language_id = '1' and ps.language_id = '1' order by s.specification_sort_order, sd.specification_name

So I get the data from the sql, but no display.

I will see if I can find anything..

Link to comment
Share on other sites

I took the query you posted, changed the category and product_id to valid numbers for my test site, and ran it against the database. It returned the expected data. Check that your values are correct, and that you have specifications entered for that product.

 

Regards

Jim

See my profile for a list of my addons and ways to get support.

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