I get this error when i try to download my pages to pdf

Fatal error: require_once() [function.require]: Failed opening required 'modules/addmodules/pdfview/tcpdf/tcpdf.php' (include_path='.;C:\php5\pear') in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\pdfview\pdfview.module on line 98

Does anyone no how to fix it?

Drupal 5.0
Configuration file Protected
Cron maintenance tasks Last run 6 min 55 sec ago
You can run cron manually.
Database schema Up to date
File system Writable (public download method)
GD library bundled (2.0.28 compatible)
MySQL database 5.0.24
PHP 5.1.5
Unicode library PHP Mbstring Extension
Web server Apache/2.2.3 (Win32) PHP/5.1.6

http://www.allensworld.org

Comments

tdimg’s picture

You need to have tcpdf (http://www.tecnick.com/public/code/cp_dpage.php?aiocp_dp=tcpdf) uploaded into the folder pdfview/tcpdf so that the file tcpdf.php is in that folder. The error message that you get tells you basically that this file is expected in the folder modules/addmodules/pdfview/tcpdf but isn't there.

allen’s picture

Now that i got that file in the right directory and i set up the config for it i get this error

Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\pdfview\tcpdf\config\tcpdf_config.php on line 45

These are my settings

//============================================================+
// File name   : tcpdf_config.php
// Begin       : 2004-06-11
// Last Update : 2006-12-14
//
// Description : Congiguration file for TCPDF.
//
// Author: Nicola Asuni
//
// (c) Copyright:
//               Tecnick.com S.r.l.
//               Via Ugo Foscolo n.19
//               09045 Quartu Sant'Elena (CA)
//               ITALY
//               www.tecnick.com
//               info@tecnick.com
//============================================================+

/**
 * Configuration file for TCPDF.
 * @author Nicola Asuni
 * @copyright Copyright © 2004, Tecnick.com S.r.l. - Via Ugo Foscolo n.19 - 09045 Quartu Sant'Elena (CA) - ITALY - www.tecnick.com - info@tecnick.com
 * @package com.tecnick.tcpdf
 * @version 1.53.0.TC025
 * @link http://tcpdf.sourceforge.net
 * @license http://www.gnu.org/copyleft/lesser.html LGPL
 * @since 2004-10-27
 */

// 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:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\pdfview\tcpdf\");
	
	/**
	 * url path
	 */
	define ("K_PATH_URL", "http://www.allensworld.org/modules/addmodules/pdfview/tcpdf/");
	
	/**
	 * path for PDF fonts
	 */
	define ("FPDF_FONTPATH", K_PATH_MAIN."fonts\");
	
	/**
	 * cache directory for temporary files (full path)
	 */
	define ("K_PATH_CACHE", K_PATH_MAIN."cache\");
	
	/**
	 * cache directory for temporary files (url path)
	 */
	define ("K_PATH_URL_CACHE", K_PATH_URL."cache/");
	
	/**
	 *images directory
	 */
	define ("K_PATH_IMAGES", K_PATH_MAIN."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", "pdf author");
	
	/**
	 * 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", "FreeSerif"); //vera
	
	/**
	 * main font size
	 */
	define ("PDF_FONT_SIZE_MAIN", 10);
	
	/**
	 * data font name
	 */
	define ("PDF_FONT_NAME_DATA", "FreeSerif"); //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);
}

//============================================================+
// END OF FILE                                                 
//============================================================+

What changes should i make?

tdimg’s picture

It tells you there is something (most likely some text) wrong in line 45:
Parse error: parse error, unexpected T_STRING in C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\pdfview\tcpdf\config\tcpdf_config.php on line 45

My guess would be that line 45 is this one:

define ("K_PATH_MAIN", "C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\pdfview\tcpdf\");

There are a few problems with it. first, the internet doesn't like upper case and spaces, so getting rid of these would be perfect but most likely not possible at this point. For the future, try to install your appache in a different folder, one that isn't placed in Program Files...

However, I don't think this is the major problem here, its more to do with the slash \. Having looked at the example config file, there is nowhere this slash, its always the other one: / - you've got quite a few of those \ in your settings, replace all of them with this one / and you should be fine, if not it might be the upper cases and spaces there.

allen’s picture

actually this is line 45

define ("K_PATH_URL", "http://www.allensworld.org/modules/addmodules/pdfview/tcpdf/");

but ill try to change all the slashes...

Just tryed it and it worked... I just changed them on the whole page and it seemed to work..

Thanks alot. You have any idea
with my problem with mutlidomain http://drupal.org/node/112787
or site Cache http://drupal.org/node/111281

tdimg’s picture

... unfortunately I can't help you with the other two since I haven't worked with multidomains yet nor have done anything with Drupal 5 or know about the error messages there. Try maybe another forum for the latter, I see that you posted it to the Developer groups, try posting it in the Support > upgrade forum.

xl-network’s picture

If you change the \ to / in the path it will work. The problem is \t (it is a escaped tab)

"C:\Program Files\Apache Software Foundation\Apache2.2\htdocs\allensworld\modules\addmodules\pdfview\tcpdf\"

"C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/allensworld/modules/addmodules/pdfview/tcpdf/"

allen’s picture

Thanks to both of yall

stefanwray’s picture

Am I correct in thinking that PDFview requires TCPDF, which requires PHP 5?

Stefan Wray

arindamghatak794’s picture

tcpdf has 2 versions for php4 and php5 respectively. So, based on your configuration, you've got to choose your tcpdf version. And yes, pdfview requires tcpdf.