By Ole Martin on
When I try to use this 2 modules I only get a white screen. I have read in http://www.fpdf.org/ also, but I did not understand wath to do. I'm are not familiar with PHP-coding etc. I would be verry happy if some people out there could be able to help me out.
Comments
Log
I was in my log and then I se this message
Ole Martin
http://www.drupal.no (DiN)
What module do you use?
Hello Ole,
the error means that the module can not find the tcpdf.php file.
I guess you gave PDFview a try? There is an "install" file with no file ending that describes how to install pdfview correctly. You have to download the tcpdf PHP class from Sourceforge.net. Download the class that matches our current PHP version - PHP4 or PHP5! Then follow the steps from the install file you will soon have a nice basic PDF export of your nodes.
Link: http://tcpdf.sourceforge.net
If you still have trouble, drop a line and we will help you.
With best regards
Hailstorm
Mike
Set K_PATH_MAIN costant in tcpdf/config/tcpdf_config.php
Thank you.
I have downloaded tcpdf and her is the url: all/modules/pdfview/tcpdf/
In config.php:
/**
* installation path
*/
define ("K_PATH_MAIN", "http://drupal.no/sites/all/modules/pdfview/tcpdf/");
/**
* url path
*/
define ("K_PATH_URL", "http://drupal.no/sites/all/modules/pdfview/tcpdf/");
How many times I have to set this url path?
Now I have this messagges:
"TCPDF error: Can't open image file: D:/Inetpub/wwwroot/_OPENSOURCE/tcpdf/images/logo_example.png"
But I have set new localitations with the new url, haven't I?
Ole Martin
http://www.drupal.no (DiN)
White screen again.
If anyone ca help, here are my "tcpdf_config.php"
// If you define the constant K_TCPDF_EXTERNAL_CONFIG, the following settings will be ignored.
if (!defined("K_TCPDF_EXTERNAL_CONFIG")) {
// PLEASE SET THE FOLLOWING CONSTANTS:
/**
* installation path
*/
define ("K_PATH_MAIN", "c:/tcpdf/");
/**
* url path
*/
define ("K_PATH_URL", "http://www.drupal.no/sites/all/modules/pdfview/tcpdf/");
/**
* path for PDF fonts
*/
define ("FPDF_FONTPATH", "http://www.drupal.no/sites/all/modules/pdfview/tcpdf/fonts/");
/**
* cache directory for temporary files (full path)
*/
define ("K_PATH_CACHE", http://www.drupal.no/sites/all/modules/pdfview/tcpdf/cache/");
/**
* cache directory for temporary files (url path)
*/
define ("K_PATH_URL_CACHE", http://www.drupal.no/sites/all/modules/pdfview/tcpdf/cache/");
/**
*images directory
*/
define ("K_PATH_IMAGES", http://www.drupal.no/sites/all/modules/pdfview/tcpdf/images/");
/**
* blank image
*/
define ("K_BLANK_IMAGE", K_PATH_IMAGES."_blank.png");
/**
* page format
*/
define ("PDF_PAGE_FORMAT", "A4");
/**
* page orientation (P=portrait, L=landscape)
*/
define ("PDF_PAGE_ORIENTATION", "P");
/**
* document creator
*/
define ("PDF_CREATOR", "TCPDF");
/**
* document author
*/
define ("PDF_AUTHOR", "TCPDF");
/**
* header title
*/
define ("PDF_HEADER_TITLE", "header title");
/**
* header description string
*/
define ("PDF_HEADER_STRING", "first row\nsecond row\nthird row");
/**
* image logo
*/
define ("PDF_HEADER_LOGO", "logo_example.png");
/**
* header logo image width [mm]
*/
define ("PDF_HEADER_LOGO_WIDTH", 20);
/**
* document unit of measure [pt=point, mm=millimeter, cm=centimeter, in=inch]
*/
define ("PDF_UNIT", "mm");
/**
* header margin
*/
define ("PDF_MARGIN_HEADER", 5);
/**
* footer margin
*/
define ("PDF_MARGIN_FOOTER", 10);
/**
* top margin
*/
define ("PDF_MARGIN_TOP", 27);
/**
* bottom margin
*/
define ("PDF_MARGIN_BOTTOM", 25);
/**
* left margin
*/
define ("PDF_MARGIN_LEFT", 15);
/**
* right margin
*/
define ("PDF_MARGIN_RIGHT", 15);
/**
* main font name
*/
define ("PDF_FONT_NAME_MAIN", "vera"); //vera
/**
* main font size
*/
define ("PDF_FONT_SIZE_MAIN", 10);
/**
* data font name
*/
define ("PDF_FONT_NAME_DATA", "vera"); //verase
/**
* data font size
*/
define ("PDF_FONT_SIZE_DATA", 8);
/**
* scale factor for images (number of points in user unit)
*/
define ("PDF_IMAGE_SCALE_RATIO", 4);
/**
* magnification factor for titles
*/
define("HEAD_MAGNIFICATION", 1.1);
/**
* height of cell repect font height
*/
define("K_CELL_HEIGHT_RATIO", 1.25);
/**
* title magnification respect main font size
*/
define("K_TITLE_MAGNIFICATION", 1.3);
/**
* reduction factor for small font
*/
define("K_SMALL_RATIO", 2/3);
}
Ole Martin
http://www.drupal.no (DiN)
It' a path misconfiguration I guess...
Hello Ole,
sorry for the delay in answering your question.
Well I guess this time it's a wrong path. Looking at the warning, you are using a Windows 2003/IIS 6 installation? Well I have not tested the installation of pdfview under such a configuration - but need to do for a client project the next days...
I think the tcpdf K_PATH_MAIN constant is not correct. If you look at the K_PATH_URL constant that you correctly set there is a huge difference in the paths. Under my WAMP system I configured the K_PATH_MAIN constant as an absolute path like "C:/_your_iis_web_root_directory_/sites/all/modules/pdfview/tcpdf/". The K_PATH_URL constant is correct, no changes needed here.
The rest of the configuration file is only interesting if you want to adjust the PDF-output.
I hope this will help you.
Hailstorm
Mike
Thank you for your spending
Thank you for your spending time .
Is the K_PATH_MAIN-url to the server where my site are? I used the path for my pc... I'm using a host ( http//www.netbox.no and they are using linux/unix)
On this laptop I use XP, the other pc are using Ubuntu. I think I will go for Ubuntu here also soon.
Ole Martin
http://www.drupal.no (DiN)
The right path...
Hello Ole,
if you develop your site on a local XP maschine using IIS 6? then your K_PATH_MAIN should be the absolute path starting from, for example, C:/ all the way down to your tcpdf directory - as described before. An easy way to get the absolute path is to open Windows Explorer. Navigate to your tcpdf directory and copy the path from the address bar. Paste it into the K_PATH_MAIN constant and change all back- "\" to "/" forward slashes!
The K_PATH_MAIN constant on my PC (XP, Apache2) looks like this: "E:/Server/Apache2.2/htdocs/my_drupal_project/sites/all/modules/pdfview/tcpdf/".
If you deploy your final site from Windows XP to your UNIX/Linux machine then you have to adjust the path, this time for the UNIX/Linux system. Most providers show the absolute path in their administration panel, or simply send them an email and ask for it.
The K_PATH_URL constant on my local machine is: "http://localhost/my_drupal_project/sites/all/modules/pdfview/tcpdf/". Everytime I deploy a site I have to adjust the the "localhost" part with the actual domain name.
Hailstorm
Mike