Jump to content
Sign in to follow this  
alverman

[Contribution] PDF data-sheet maker v.1.1

Recommended Posts

I think he is asking for help here on HOW to integrate the 2 so that the PDF file will show the added description that is not being displayed now.


L8r,

PopTheTop

 

Published osC Contributions:

- eCheck Payment Module v3.1

- Reviews in Product Display v2.0

- Fancier Invoice & Packingslip v6.1

- Admin Notes / Customer Notes v2.2

- Customer Zip & State Validation v2.2

- Search Box with Dropdown Category Menu v1.0

 

Pop your camper's top today!

It's a popup thing...

You wouldn't understand

Share this post


Link to post
Share on other sites
Hello,

 

I have a similar problem to that mentioned above.  When I select the pdf icon I am invited to download the file rather than get it displayed. Also, the file offered for download is pdf_datasheet.php, so not even a pdf!  I expect I made a silly mistake somewhere - any ideas?

 

I have checked my acrobat settings in edit->preferences->internet and display PDF in browser is SET.

 

cheers

Simon

The same happens here, any solution to get rid of it?

 

Tia,

Share this post


Link to post
Share on other sites

THere is a problem with the file for version 1.4.

 

It doesnt include the file /catalog/pdf_datasheet.php

 

Let me know once the new package is online.

 

Cheers,

Chris

Share this post


Link to post
Share on other sites
Yeah, would really appreciate the missing pdf_datasheet.php file.  Thanks again for all the great work :)

 

Does anyone have that missing file?

 

Does the writer of the contribution even read this support thread?

Share this post


Link to post
Share on other sites

Does anybody have a standard pdf_datasheet_config file? I liked the setup on the sample site and wanted something similar. I found the file a bit confusing so wondered if anyone has one that I can just upload please.

Share this post


Link to post
Share on other sites
Doh!...Sorry Guys ignore the post above. I sorted it, I think it's been a long day.

 

But does anyone have a fix that will display a product description properly that contains HTML (images and tables etc)

I want to be able to produce the PDF for products like the link below:

 

http://www.gocoffee.co.uk/catalog/product_...&products_id=65

 

 

Yeah I would also like to be able to export HTML to the PDF file. Is there anyone who knows how to do it?

 

Cheers,

Chris :)

Share this post


Link to post
Share on other sites

Hi all,

 

I am having problems with v1.3.

 

My product images are almost all the way off the right hand side of the page. Past the right hand extreme of the text descriptions etc.

 

I assume this is positioned in pdf_datasheet_functions.php

 

I have no idea how to set it though:

 

Here is my current code from line 208 to 324

 

 

 

function ShowImage(&$width,&$height,$path,$loc='',$x_pos=1)

{

$width=min($width,PDF_MAX_IMAGE_WIDTH);

$height = (IMAGE_KEEP_PROPORTIONS != 0 ? $height : min($height,PDF_MAX_IMAGE_HEIGHT));

$this->SetLineWidth(1);

$this->Cell($width,$height,"",0,0);

$this->SetLineWidth(0.2);

$pos=strrpos($path,'.');

$type=substr(strtolower($path),$pos+1);

if($type=='jpg' or $type=='jpeg' or $type=='png' or $type=='gif'){

if ($loc==false){

$this->Image($path,($this->GetX()-$width)+1, $this->GetY(), $width, $height);

}else{

$this->SetY(($this->GetY())+5);

$this->Image($path,$x_pos +1, $this->GetY(), $width, $height);

}

}else{

$this->SetDrawColor(230,230,230);

if($loc==false){

$this->x = $this->GetX()-$width;

}else{

$this->x = $this->GetX();

}

$this->SetTextColor(230,230,230);

$this->Cell($width,$height,'No image',1,0,C);

$this->SetTextColor(0);

$this->SetDrawColor(0);

}

}

 

function CalculatedSpace($y1,$y2,$imageheight)

{

//Si les commentaires sont - importants que l'image au niveau de l'espace d'affichage

if(($h2=$y2-$y1) < $imageheight)

{

$this->Ln(($imageheight-$h2)+3);

}

else

{

$this->Ln(3);

}

}

 

function DrawCells($data_array)

{

$totallines=0;

 

for($i=2;$i<(sizeof($data_array)-1);$i++)

{

$totallines+=$this->NbLines((220-$data_array[0]),$data_array[$i]);

}

 

//5 = cells height

$h=5*$totallines."<br>";

 

//if products description takes the whole page height goes to new page

if($h<TEXT_HEIGHT)

{

$this->CheckPageBreak($h);

}

if(SHOW_IMAGES && strlen($data_array[10]))

{

//If custom image

if(PDF_IMAGE_KEEP_PROPORTIONS != 0 )

{

$heightwidth=getimagesize($data_array[10]);

$factor = $heightwidth[0]/$heightwidth[1];

$data_array[0]=$imagewidth=PDF_MAX_IMAGE_WIDTH*PDF_TO_MM_FACTOR;

// Bild in Orginalgr??e abbilden, maximale Gr??e ignorieren

// $data_array[0]=$imagewidth=$heightwidth[1]*PDF_TO_MM_FACTOR;

$data_array[1]=$data_array[0]/$factor;

 

$this->ShowImage($data_array[0],$data_array[1],$data_array[10]);

$y1=$this->GetY();

}

 

//If Small Image Width and Small Image Height are defined

else if(strlen($data_array[0])>1 && strlen($data_array[1])>1)

{

$this->ShowImage($data_array[0],$data_array[1],$data_array[10]);

$y1=$this->GetY();

}

//If only Small Image Width is defined

else if(strlen($data_array[0])>1 && strlen($data_array[1]))

{

$heightwidth=getimagesize($data_array[10]);

$data_array[0]=$data_array[0];

$data_array[1]=$heightwidth[1]*PDF_TO_MM_FACTOR;

 

$this->ShowImage($data_array[0],$data_array[1],$data_array[10]);

$y1=$this->GetY();

}

//If only Small Image Height is defined

else if(strlen($data_array[0]) && strlen($data_array[1])>1)

{

$heightwidth=getimagesize($data_array[10]);

$data_array[0]=$width=$heightwidth[0]*PDF_TO_MM_FACTOR;

$data_array[1]=$data_array[1];

 

$this->ShowImage($data_array[0],$data_array[1],$data_array[10]);

$y1=$this->GetY();

}

else

{

$heightwidth=getimagesize($data_array[10]);

$data_array[0]=$heightwidth[0]*PDF_TO_MM_FACTOR;

$data_array[1]=$heightwidth[1]*PDF_TO_MM_FACTOR;

 

$this->ShowImage($data_array[0],$data_array[1],$data_array[10]);

$y1=$this->GetY();

}

}

else

{

$data_array[0]=$data_array[1]=0;

$y1=$this->GetY();

}

Share this post


Link to post
Share on other sites

Well,

Here goes: I just installed this Contribution and am getting these errors:

 

Warning: getimagesize(/images/Blaupunkt_Silverstone_C34-t.jpg): failed to open stream: No such file or directory in /usr1/digirati/www.mysite.com/pdf/pdf_datasheet_functions.php on line 273

 

Warning: Division by zero in /usr1/digirati/www.mysite.com/pdf/pdf_datasheet_functions.php on line 274

 

Warning: Division by zero in /usr1/digirati/www.mysite.com/pdf/pdf_datasheet_functions.php on line 278

 

Warning: getimagesize(/images/Blaupunkt_Silverstone_C34-t.jpg): failed to open stream: No such file or directory in /usr1/digirati/www.mysite.com/pdf/fpdf/fpdf.php on line 1488

FPDF error: Missing or incorrect image file: /images/Blaupunkt_Silverstone_C34-t.jpg

 

All I can add is that the file it's pointing to is definitely there... can anyone give me a hand and let me know why PDF data-sheet maker is not finding it?

 

Thank you so much in advance,

BD

Edited by BoulderDash

Share this post


Link to post
Share on other sites
Well,

Here goes: I just installed this Contribution and am getting these errors:

All I can add is that the file it's pointing to is definitely there... can anyone give me a hand and let me know why PDF data-sheet maker is not finding it?

 

Thank you so much in advance,

BD

 

 

Hey,

 

I don't know exactly why you are having that problem, but I am assuming you have it set to resize images.

One thing to note is that you need to have your image sizes GREATER than the small image size you have set in your OsCommerce Installation. Otherwise it tries to shrink a smaller image to a size that is actually bigger, therefore creating errors.

 

Try also turning off image resizing.

 

Another thing might be that the image path could be incorrect. It might be looking for the FULL File System path, rather than the relative path.

 

Hope this helps a bit.

 

Cheers,

Chris :)

Share this post


Link to post
Share on other sites

Hi all

 

When define('SHOW_PATH',0); is set to 0 i still get the category path and product name at the top. It is too long...anyone know how to cut it down or remove the code?

Share this post


Link to post
Share on other sites

Hello everybody,

 

Be cool with my english but it's not my standard language :blush:

 

I have installed the latest version Full package Spanish and French but when I click on the PDF Logo :

1) I have a white page if in the Admin panel I put Redirect or download on 1 (1 = redirect) (You can see that on my demo site).

2) If I put Redirect or download on 0 (0 = download) have this message :

Parse error: parse error in (...)\catalog\pdf\pdf_datasheet_config.php on line 13

but at the error code position I have this code :

" $this->SetFont('helvetica','B',18); " in pdf_datasheet_functions.php defines txt style,  ---> (font face) , [empty string: regular - B: bold - I: italic - U: underline ], (size)

 

Can you help me please ?

 

Thanks a lot from France.

Share this post


Link to post
Share on other sites

I'm running V1.5 and i have other product info (cusotmized fields) that I would also like to display in the PDF sheet.

 

I have a total of 3 other fields, and it looks like only the regukar data is being sdisplayed by a $data_array[id].

 

How can i get the other information I'd like to get displayed, into the PDF sheet?

(All the Data i'm wishing to get posted to the datasheet are in the products database table)

Share this post


Link to post
Share on other sites

I have this problem with "PDF data_sheet maker" . I have follow all the instructions in readme.txt to install correctly this contribuition but watch what hapenned :

when a click on one product (pdf icon -- > http://yoursite/catalog/pdf_datasheet.php/products_id/) i have this erros :

 

Warning getimagesize(): Read error! in home/cs/public_html/pdf/pdf_datasheet_functions.php on line 273

Warning Division by zero in /home/cs/public_html/pdf/pdf_datasheet_functions.php on line 274

Warning</b>: Division by zero in <b>/home/cs/public_html/pdf/pdf_datasheet_functions.php on line 278

 

line 273 @ file pdf_datasheet_functions.php = $heightwidth=getimagesize($data_array[10]);

line 274 @ file pdf_datasheet_functions.php = $factor = $heightwidth[0]/$heightwidth[1];

line 278 @ file pdf_datasheet_functions.php = $data_array[1]=$data_array[0]/$factor;

 

So .... what?s your solution for my problem ??? i?m despairing !!!

best regards and thanks in advance ,

 

Jo?o Nuno Oliveira

Share this post


Link to post
Share on other sites

I have installed the last version of this contribution. I have the following problem: if Save septum the generated document on the server=1, generates me rows pdf but with error in the price (you see

figure) lacking also to cite the special price.

 

errorepdf.jpg

 

If Save septum the generated document on the server=0 generates to me

 

<br />

<b>Warning</b>: Missing argument 3 for display_price() in <b>/web/htdocs/www.arclima.it/home/catalog/includes/classes/currencies.php</b> on line <b>74</b><br />

%PDF-1.3

3 0 obj

<</Type /Page

/Parent 1 0 R

/Resources 2 0 R

/Annots [<</Type /Annot /Subtype /Link /Rect [59.53 18.17 233.51 10.17] /Border [0 0 0] /A <</S /URI /URI (mailto:info@arclima.it)>>>>]

/Contents 4 0 R>>

 

and incomprensibile series of characters continues with one

Thanks of the aid

Share this post


Link to post
Share on other sites

Hi!

I can't find the answer to this (strange, cause I can't be the only one, can I?)

Products without images renders this browser window:

Warning: getimagesize(images/11910.jpg): failed to open stream: No such file or directory in /company/www/catalog/pdf/pdf_datasheet_functions.php on line 274

 

Warning: Division by zero in /company/www/catalog/pdf/pdf_datasheet_functions.php on line 275

 

Warning: Division by zero in /company/www/catalog/pdf/pdf_datasheet_functions.php on line 279

 

Warning: getimagesize(images/11910.jpg): failed to open stream: No such file or directory in /company/www/catalog/pdf/fpdf/fpdf.php on line 1488

FPDF error: Missing or incorrect image file: images/11910.jpg

Products with images renders perfect PDF:s!

Question: How do I make this contrib work with products without images too?

I tried this tweak:

if(SHOW_IMAGES && strlen($data_array[10])<=1)

... but then no images are show even if they exist.

Share this post


Link to post
Share on other sites

Hi, firstly like to say this is a great contibution...

 

i got it working perfectly fine on my first site, but on my second i get the following error

 

Warning: open_basedir restriction in effect. File is in wrong directory in /home/httpd/vhosts/mysite.co.uk/httpdocs/catalog/pdf/fpdf/fpdf.php on line 1596

 

Warning: Cannot add header information - headers already sent by (output started at /home/httpd/vhosts/mysite.co.uk/httpdocs/catalog/pdf/fpdf/fpdf.php:1596) in /home/httpd/vhosts/mysite.co.uk/httpdocs/catalog/pdf/fpdf/fpdf.php on line 1022

FPDF error: Some data has already been output to browser, can't send PDF file

 

anyone know what that could be?

 

thanx in advance

 

regards

Share this post


Link to post
Share on other sites

sorry delete this, said server was busy so refreshed and it got posted twice

Edited by a_i786

Share this post


Link to post
Share on other sites

I had this problem, and i re-installed it and it solved, you might aswell install it again, will be quick

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×