Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

PDF page maker


quint

Recommended Posts

Considering previous experiences, I think it has to do with 'search engine friendly pages' URL format. If you run

http://www.scales-r-us.com/pdf_datasheet.php?products_id=244

the pdf should be generated.

I wouldn't know how you can have both, never tried.

Link to comment
Share on other sites

If i use that link i get asked if i want to open, save or cancel. If i open the following code appears in my dreamweaver MX program code panel. never looked at a pdf source before, so can you tell me if this has been populated by the product or is this the default output of PDF_Maker?

 

%PDF-1.3

3 0 obj

<</Type /Page

/Parent 1 0 R

/Resources 2 0 R

/Annots [><</Type /Annot /Subtype /Link /Rect [62.36 34.26 339.60 25.26] /Border [0 0 0] /A ><</S /URI /URI (mailto: e-mail@address )>>>>]

/Contents 4 0 R>>

endobj

4 0 obj

<</Filter /FlateDecode /Length 837>>

stream

x??T?r?F??+?)eW	#̳??T$9r?)????ɗ18'#ɿ?M.2?

?Yد_w?n????I??d&???3???`R?L?&3D??q??]/py?ab?X???????ℾ2??i3=$	3"%t?|

z?5??K?	V??, 4???b?mnK?FM?mY^?_b?7???ه?%7{?=??`?M:???L??ʰT?7~?.??  ?@i"X"?5g|@??n?,????m?. b?

??C޵??g=e~<??>??0?,8w??0????p?,?}?p?TQM)?ѻ??l?_pS?

?>????qg?ܕ?ݳT<O?yZ"???h	??9O?'????y???Q?3I/???2?%{?i?)P.es?u?????}99??@W?xU??X???D??Q6F&??"?[m?mN?w

??m????q??ʕ?	[aB?6????^?X???-Au?X?b??8???T??????m?	`?25D1???~!????????v??????Yc;??? ?b??w7?????z??$ʸ8a??C0??ݔ$????B???Ko?.??6'R!?Eַ??|U???$?GꞄ???H -?1'?>F???]?sG???U?J????j|~??'?q

?n>??p8KE/,#??د??qi?!?4K

5?(??w????????(?LC???M?s???2<???????_|ٗg??-6M?ܒLl??????!?P???

??Ӊ??O?p:l??q?h?dfIF?S???&?~?

??P;?H??

????5E??!?ռk??.pC)??fUWI*?6???g????ZȩM?l??/?????nķ

endstream

endobj

1 0 obj

</Type /Pages

/Kids [3 0 R ]

/Count 1

/MediaBox [0 0 595.28 841.89]

>>

endobj

5 0 obj

<</Type /Font

/BaseFont /Helvetica-Bold

/Subtype /Type1

/Encoding /WinAnsiEncoding

>>

endobj

6 0 obj

<</Type /Font

/BaseFont /Helvetica

/Subtype /Type1

/Encoding /WinAnsiEncoding

>>

endobj

7 0 obj

<</Type /Font

/BaseFont /Helvetica-Oblique

/Subtype /Type1

/Encoding /WinAnsiEncoding

>>

endobj

8 0 obj

<</Type /XObject

/Subtype /Image

/Width 100

/Height 80

/ColorSpace /DeviceRGB

/BitsPerComponent 8

/Filter /DCTDecode

/Length 2388>>

stream

????JFIFHH??C    !"$"$??C??
Pd"??	

?ĵ}!1AQa"q2???#B??R??$3br?	

%&'()*456789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz????????????????????????????????????????????
???????????????????????????????	

?ĵw!1AQaq"2?B????	#3R?br?

$4?%?&'()*56789:CDEFGHIJSTUVWXYZcdefghijstuvwxyz????????????????????????????????????????????
????????????????????????????????.??????????

?o<ww??????Q??}?g????^??]S?z????+x???~G?S???B??Y?BO?e??f???E??????????>??˕??Jȟy`??S$?Urˀ;?)?v;??`qm?g??/????u?ɟ%- ɸ????[I?ϝy

?????P???nH??7???~??;?ω<Gq?7W?D????y?d???????j??G?l??i?HoFy	??Y?Y??I??Đ???g4]!?z4?1??c?<Z{???Z0??n?????!???ߕn?~?+?>|?}??<M???rG&MC1???aG0s?i???h?Zx?bW?????-???+N???ɮ7LG#?????^???)?u???xCKtic?O????l??,????m??F~B??7q?Eٿҭ/??Kv??%1H0і?>?8??QHAEP??A??_??<o-x?n?L?^??d?}????J???I?????i? -e?~C?D=A??Э'????

y??㺨???}????	

q,?????ףJ???ݖ??+?X?g???6????K'??8??&????$^դӴO????X]Ir????͜???W?K???Y?O??k"?`Gie)?@a??+??;fH??n#??{??r?j???jXF'?f?9Z'`?Y??S?n??4?/V>-????,??.{??x?#*?u?5?ms??G ????H???@??He:?Z???[/??S?EPw?CJ?2?:o?q????	? 

????Y?????}?t??+[DŽ??u2y???AXVM?ߡ?8?Z??-%???IԪ??qQ??"F????j?ǩ?*??e??y`?J????????*?*????q?n??"??h1?KD?vKw?<s??7??X???te?,w?J??

??`~f?(?nm?ۖ???{?w?l|-?gF՘;?v???9?????=F?ܺ??u$?돥???7Fv????B*n??a? &H??K?;J?G??630????a?_S???u?ka?=y???՗f??7?x??jP ??(???m?????.c??????????'???7?M???8?X?J?Q@TN?????]???r?????k??(?l?Lg???ij???????ґ{?n?Kxu

???r?F??m??v?????k??|?F?o???ˏ???Dd?S?t>??/r???H????V???}G5??_?>?

??cm4?~`??c??	S????唓???`????U[?H?^7??W???9??? ?vX?E?	???a??b?G?GlT?T?@?7I?p?I?v????9'??

??<?2?06?H?3?q? 

{V>@#?-m?@á?Fd?kcOm??;??(??)??KG"+?2??"?Eyw???%?

G?KQ?}????Wl줡? ?

}??|i????mԶ>Y?????Rg?i?n"?uF+?	8?NA?yM͵֟vַ??3'U????8?5???$Zƭ6ђ??O??۲?J?Ҟ?<?Q##?;???)#?P?1???

F~??U'?5???MB??A´ϱ	ϯ?ޢ???:?9??Cm?Dz?e????J?P?)%?vW1u??7?y??DP??j7??]???=k"?????}N?p#???'????0??R???ծ???????]n??Xi??l??A?1 Q?S??{?????W?.???#?Я?Y??p???????????`?	??Z???n!?????)??Wh??II??"??w

(? ???

endstream

endobj

2 0 obj

</ProcSet [/PDF /Text /ImageB /ImageC /ImageI]

/Font ><<

/F1 5 0 R

/F2 6 0 R

/F3 7 0 R

>>

/XObject <<

/I1 8 0 R

>>

>>

endobj

9 0 obj

<<

/Producer (FPDF 1.51)

/CreationDate (D:20030628004029)

>>

endobj

10 0 obj

<<

/Type /Catalog

/Pages 1 0 R

/OpenAction [3 0 R /XYZ null null 1]

/PageLayout /OneColumn

>>

endobj

xref

0 11

0000000000 65535 f 

0000001131 00000 n 

0000004072 00000 n 

0000000009 00000 n 

0000000224 00000 n 

0000001218 00000 n 

0000001319 00000 n 

0000001415 00000 n 

0000001519 00000 n 

0000004205 00000 n 

0000004281 00000 n 

trailer

<<

/Size 11

/Root 10 0 R

/Info 9 0 R

>>

startxref

4391

%%EOF

Link to comment
Share on other sites

ok ive turned off the safe urls

 

if i left click on it i still get acrobat opening but "the file is damaged and beyond repair" and a blank screen

 

if i right click and save the file doc.pdf then i can open it and it works fine

Link to comment
Share on other sites

It could be a matter of browser/plug-in settings, I do not know..

Two hints:

a) Take a look at the FAQs from the FPDF site.

 

B) Use this workaround to create a PDF file to the server and then link to it :

 

1) in pdf_functions replace

$pdf->Output("",false);

with:

$pdf->Output("pdf/datasheets/".$products_id.".pdf",false);

2) create a folder named "datasheets" inside "catalog/pdf" folder (Chmod 777)

3) change the PDF icon link to:

<?php echo '<a href="' . tep_href_link('pdf_info.php', 'products_id=' . $product_info['products_id']) .'" target="_self">' . tep_image('pdf_files/pdf.gif') .'</a>'; ?></td>

4) create a new php file and call it pdf_infp.php and place these lines of code inside (you can duplicate an existing one and replace the code)

<?php 

 require('includes/application_top.php'); 

 require('pdf/pdf_datasheet_functions.php'); 

 require(DIR_WS_LANGUAGES . $language . '/' . FILENAME_PDF_DATASHEET); 



 $location = ' » <a href="' . tep_href_link(FILENAME_SHIPPING, '', 'NONSSL') . '" class="headerNavigation">' . NAVBAR_TITLE . '</a>'; 

?> 

<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN"> 

<html <?php echo HTML_PARAMS; ?>> 

<head> 

<meta http-equiv="Content-Type" content="text/html; charset=<?php echo CHARSET; ?>"> 

<title><?php echo TITLE; ?></title> 

<base href="<?php echo (($request_type == 'SSL') ? HTTPS_SERVER : HTTP_SERVER) . DIR_WS_CATALOG; ?>"> 

<link rel="stylesheet" type="text/css" href="stylesheet.css"> 



</head> 

<body marginwidth="0" marginheight="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> 

<!-- header //--> 

<?php require(DIR_WS_INCLUDES . 'header.php'); ?> 

<!-- header_eof //--> 



<!-- body //--> 

<table border="0" width="100%" cellspacing="3" cellpadding="3"> 

 <tr> 

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?> " cellspacing="0" cellpadding="2"> 

<!-- left_navigation //--> 

<?php require(DIR_WS_INCLUDES . 'column_left.php'); ?> 

<!-- left_navigation_eof //--> 

   </table></td> 

<!-- body_text //--> 

   <td width="100%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> 

     <tr> 

       <td width="100%"><table border="0" width="100%" cellspacing="0" cellpadding="0"> 

         <tr> 

           <td class="pageHeading"><?php echo HEADING_TITLE; ?></td> 

         </tr> 

       </table></td> 

     </tr> 

     <tr> 

       <td><?php echo tep_draw_separator('pixel_trans.gif', '100%', '10'); ?></td> 

     </tr> 

     <tr> 

       <td><table border="0" width="100%" cellspacing="0" cellpadding="2"> 

         <tr> 

           <td class="main"> 

<?php 

$file = $products_id .'.pdf'; 

$size_pdf_file=filesize('pdf/datasheets/'. $file )/1024; 

$formatted = sprintf('%0.2f Kb', $size_pdf_file); 

echo '<br><a href=pdf/datasheets/'.$file.' target=_blank>Click to download '.$file.'</a> ('.$formatted.')';?> 

           </td> 

         </tr> 

       </table></td> 

     </tr> 

     <tr> 

       <td align="right" class="main"><br><?php echo '<a href="' . tep_href_link(FILENAME_DEFAULT, '', 'NONSSL') . '">' . tep_image_button('button_continue.gif', IMAGE_BUTTON_CONTINUE) . '</a>'; ?></td> 

     </tr> 

   </table></td> 

<!-- body_text_eof //--> 

   <td width="<?php echo BOX_WIDTH; ?>" valign="top"><table border="0" width="<?php echo BOX_WIDTH; ?>" cellspacing="0" cellpadding="2"> 

<!-- right_navigation //--> 

<?php require(DIR_WS_INCLUDES . 'column_right.php'); ?> 

<!-- right_navigation_eof //--> 

   </table></td> 

 </tr> 

</table> 

<!-- body_eof //--> 



<!-- footer //--> 

<?php require(DIR_WS_INCLUDES . 'footer.php'); ?> 

<!-- footer_eof //--> 

<br> 

</body> 

</html> 

<?php require(DIR_WS_INCLUDES . 'application_bottom.php'); ?>

what does this do:

the first click on the PDF icon (in product_infp.php) takes you to the new page pdf_info.php, this page generates and stores the PDF file in the "datasheets" dir by means of require('pdf/pdf_datasheet_functions.php'); on top of the page; then the link "Click to download ...." opens a new window loading the just created PDF file.

You can see that this is not a straight operation, but requires two clicks to reach the PDF.

The names I gave to folder and files are just my choice, you can change them to whatever you want.

HTH

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