We help IT Professionals succeed at work.

Generate PDF's using TCPDF - Initial Set Up

Ridgejp
Ridgejp asked
on
2,910 Views
Last Modified: 2017-04-11
Hi,

Just trying to get going with the initial setup so I can learn the basic's but struggling to get to grips which the location of/and which are the basic include files?

Any help would be greatly appreciated ... the new github location states that full installation instructions are available at tcpdg.org but I'm struggling to locate them?

J
Comment
Watch Question

CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
The examples on the site seem fairly self-explanatory
https://tcpdf.org/examples/example_001/

Try that and if you don't come right post back and I will try a green fields install.

Author

Commented:
It's the include file in the php that I'm struggling with ... what's the location of 'tcpdf_include.php'?

Author

Commented:
Sorry didn't quite explain myself there ...

I understand I need to download the 'tcpdf_include.php' referenced in the example you cited and upload it to my server - I just can't find it on the site ... when I go to GitHub the file can be located but it then references further files such as tcpdf.php, tcpdf_config.php after which I got a little lost.
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
The main file is this one

https://github.com/tecnickcom/TCPDF/blob/master/tcpdf.php

If you look at that you see it includes these
// TCPDF configuration
require_once(dirname(__FILE__).'/tcpdf_autoconfig.php');
// TCPDF static font methods and data
require_once(dirname(__FILE__).'/include/tcpdf_font_data.php');
// TCPDF static font methods and data
require_once(dirname(__FILE__).'/include/tcpdf_fonts.php');
// TCPDF static color methods and data
require_once(dirname(__FILE__).'/include/tcpdf_colors.php');
// TCPDF static image methods and data
require_once(dirname(__FILE__).'/include/tcpdf_images.php');
// TCPDF static methods and data
require_once(dirname(__FILE__).'/include/tcpdf_static.php');

Open in new window


You can check each of the above for further includes but it looks like if you have the files in the root and the includes folder you should be set.

You can then include tcpdf.php from anywhere - it loads the other files relative to where IT is.

Author

Commented:
Ok I'll work through those and come back to you.
Thanks
Most Valuable Expert 2011
Author of the Year 2014
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION

Author

Commented:
Thank you both ... spent some time looking at both examples and finally think I've got a basis now for starting to do some testing.

Really appreciate your input as alway ... just don't leave the country I've got loads more questions to come!

J
CERTIFIED EXPERT
Most Valuable Expert 2017
Distinguished Expert 2019

Commented:
You are welcome.