Current location: Hot Scripts Forums » Programming Languages » PHP » Generating PDF


Generating PDF

Reply
  #1 (permalink)  
Old 03-02-08, 10:49 AM
TenFormer's Avatar
TenFormer TenFormer is offline
Newbie Coder
 
Join Date: Jan 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Generating PDF

Hey all,

I used R&OS PDF Library to generate a pdf file, and it works great.

But all quotes or apostrophes show up as weired set of characters.

An apostrophe for example would be:


I have no idea what to do, and hoped, perhaps someone her worked with that library before ? I can't use the "official" extensions because my webhoster won't install it.


Thanks
Max
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 03-02-08, 12:57 PM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Posting your php code along with an example of the source text that produces the problem would help so that someone could reproduce and experiment to find out what is happening.

Putting single and double quotes on the Author's demo page works, so this is likely something to do with the character encoding, fonts, or something else specific to what you are doing or even something about your PDF reader.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???

Last edited by mab; 03-02-08 at 01:00 PM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 03-03-08, 05:16 AM
TenFormer's Avatar
TenFormer TenFormer is offline
Newbie Coder
 
Join Date: Jan 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Hey mab, thanks for the reply.


Well it can't be my PDF reader since a friend of mine sees the exact same output. You can check it out yourself at www.modernm.info/contractgen/

Basically, I am doing the exact same thing as in the readme.php of the library.
PHP Code:

if(isset($_SESSION['contractname']))

{
    if(
$_SESSION['contract'])
    {
        
//Start generating PDF Document
        
        // define a clas extension to allow the use of a callback to get the table of contents, and to put the dots in the toc
        
class Creport extends Cezpdf {
        
            var 
$reportContents = array();
            
            function 
Creport($p,$o){
              
$this->Cezpdf($p,$o);
            }
            
            function 
rf($info){
              
// this callback records all of the table of contents entries, it also places a destination marker there
              // so that it can be linked too
              
$tmp $info['p'];
              
$lvl $tmp[0];
              
$lbl rawurldecode(substr($tmp,1));
              
$num=$this->ezWhatPageNumber($this->ezGetCurrentPageNumber());
              
$this->reportContents[] = array($lbl,$num,$lvl );
              
$this->addDestination('toc'.(count($this->reportContents)-1),'FitH',$info['y']+$info['height']);
            }
            
            function 
dots($info)
            {
              
// draw a dotted line over to the right and put on a page number
              
$tmp $info['p'];
              
$lvl $tmp[0];
              
$lbl substr($tmp,1);
              
$xpos 520;
            
              switch(
$lvl)
              {
                case 
'1':
                  
$size=16;
                  
$thick=1;
                  break;
                case 
'2':
                  
$size=12;
                  
$thick=0.5;
                  break;
              }
            
              
$this->saveState();
              
$this->setLineStyle($thick,'round','',array(0,10));
              
$this->line($xpos,$info['y'],$info['x']+5,$info['y']);
              
$this->restoreState();
              
$this->addText($xpos+5,$info['y'],$size,$lbl);
            
            
            }
        
        }
        
        
//set format to A4
        // this code has been modified to use ezpdf.
        
        
$pdf = new Creport('a4','portrait');
        
        
$pdf -> ezSetMargins(50,70,50,50);
        
        
// put a line top and bottom on all the pages
        
$all $pdf->openObject();
        
$pdf->saveState();
        
$pdf->setStrokeColor(0,0,0,1);
        
$pdf->line(20,40,578,40);
        
$pdf->line(20,822,578,822);
        
$pdf->addText(50,34,6,'Generated by Contractgenerator v1.0');
        
$pdf->restoreState();
        
$pdf->closeObject();
        
// note that object can be told to appear on just odd or even pages by changing 'all' to 'odd'
        // or 'even'.
        
$pdf->addObject($all,'all');
        
        
$pdf->ezSetDy(-100);
        
        
//$mainFont = './fonts/Helvetica.afm';
        
$mainFont './fonts/Times-Roman.afm';
        
$codeFont './fonts/Courier.afm';
        
// select a font
        
$pdf->selectFont($mainFont);
        
        
$pdf->ezText($_SESSION['contractname'] . "\n",30,array('justification'=>'centre'));
        
// modified to use the local file if it can
        
        
$pdf->openHere('Fit');
        
        
$pdf->selectFont($mainFont);
        
        
// load up the document content
        
$data explode("\n"$_SESSION['contract']);
        
        
        
$pdf->ezNewPage();
        
        
$pdf->ezStartPageNumbers(500,28,10,'','',1);
        
        
$size=12;
        
$height $pdf->getFontHeight($size);
        
$textOptions = array('justification'=>'full');
        
$collecting=0;
        
$code='';
        
        foreach (
$data as $line)
        {
          
// go through each line, showing it as required, if it is surrounded by '<>' then 
          // assume that it is a title
          
$line=chop($line);
          if (
strlen($line) && $line[0]=='#')
          {
            
// comment, or new page request
            
switch($line)
            {
              case 
'#NP':
                
$pdf->ezNewPage();
                break;
              case 
'#C':
                
$pdf->selectFont($codeFont);
                
$textOptions = array('justification'=>'left','left'=>20,'right'=>20);
                
$size=10;
                break;
              case 
'#c':
                
$pdf->selectFont($mainFont);
                
$textOptions = array('justification'=>'full');
                
$size=12;
                break;
              case 
'#X':
                
$collecting=1;
                break;
              case 
'#x':
                
$pdf->saveState();
                eval(
$code);
                
$pdf->restoreState();
                
$pdf->selectFont($mainFont);
                
$code='';
                
$collecting=0;
                break;
            }
            
          } 
          else if (
$collecting)
          {
            
$code.=$line;
          } 
          else if (((
strlen($line)>&& $line[1]=='<') ) && $line[strlen($line)-1]=='>'
          {
            
// then this is a title
            
switch($line[0])
            {
              case 
'1':
                
$tmp substr($line,2,strlen($line)-3);
                
$tmp2 $tmp.'<C:rf:1'.rawurlencode($tmp).'>';
                
$pdf->ezText($tmp2,26,array('justification'=>'centre'));
                break;
              default:
                
$tmp substr($line,2,strlen($line)-3);
                
// add a grey bar, highlighting the change
                
$tmp2 $tmp.'<C:rf:2'.rawurlencode($tmp).'>';
                
$pdf->transaction('start');
                
$ok=0;
                while (!
$ok)
                {
                  
$thisPageNum $pdf->ezPageCount;
                  
$pdf->saveState();
                  
$pdf->setColor(0.9,0.9,0.9);
                  
$pdf->filledRectangle($pdf->ez['leftMargin'],$pdf->y-$pdf->getFontHeight(18)+$pdf->getFontDecender(18),$pdf->ez['pageWidth']-$pdf->ez['leftMargin']-$pdf->ez['rightMargin'],$pdf->getFontHeight(18));
                  
$pdf->restoreState();
                  
$pdf->ezText($tmp2,18,array('justification'=>'left'));
                  if (
$pdf->ezPageCount==$thisPageNum)
                  {
                    
$pdf->transaction('commit');
                    
$ok=1;
                  } 
                  else 
                  {
                    
// then we have moved onto a new page, bad bad, as the background colour will be on the old one
                    
$pdf->transaction('rewind');
                    
$pdf->ezNewPage();
                  }
                }
                break;
            }
          } 
          else 
          {
            
// then this is just text
            // the ezpdf function will take care of all of the wrapping etc.
            
$pdf->ezText($line,$size,$textOptions);
          }
          
        }
        
        
$pdf->ezStopPageNumbers(1,1);
        
        
        
        if (isset(
$d) && $d)
        {
          
$pdfcode $pdf->ezOutput(1);
          
$pdfcode str_replace("\n","\n<br>",htmlspecialchars($pdfcode));
          echo 
'<html><body>';
          echo 
trim($pdfcode);
          echo 
'</body></html>';
        } 
        else 
        {
          
$pdf->ezStream();
        } 
Just without fancy stuff like tables, index and so on.

I reuploaded all fonts necessary, the class files, but still the same effect.


I really don't have an idea what to do anymore.
Download Class Source (without fonts)

Would be great if someone could help me, in case not, do you know another easy to use Library for generating PDF documents?

Thanks,
Max
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 03-03-08, 10:15 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Data that gets entered in the form that contains quotes does not seem to be affected. It is only pre-existing text in your template.

Your code and possible the magic quotes setting are inserting multiple escape \ characters, at several different stages. You should actually be stripping these out rather than adding them or leaving them in. This might be what is causing the problem or the template text that you are using might have been saved with some character encoding that is causing this.

Are you using any htmlentities/htmlspecialchars functions on the text at any time before it is being converted to a pdf file?

We actually need to see your code that is reading or retrieving the template, inserting the user entered values, and calling the pdf functions. Seeing just the pdf class's code does not tell us any useful information that we could not get from the author's web site.
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 03-03-08, 11:00 AM
TenFormer's Avatar
TenFormer TenFormer is offline
Newbie Coder
 
Join Date: Jan 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
I thought about encoding already as well, but there is no note that encoding might play a role on the library homepage.

Basically, the following is taking place:
Quote:
{description: Agreement between Broker and Carrier. Whatever you enter inbetween these tags will later be displayed as description. This can be as long as you want it to be, but should stay in the same line. Do not use ENTER for the description, as this would make loading of description too long.:description}
{requiredfield:field:Carrier:Carrier Name}
{requiredfield:field:Broker:Broker Name}
{requiredfield:field:Carrmc:Carrier licensed according to Docket No. MC#}
{requiredfield:field:Brokermc:Broker licensed according to Docket No. MC#}
{requiredfield:field:State:Contract applies in State of}
BROKER / CARRIER AGREEMENT

This Agreement shall govern the services provided by , {Carrier} licensed motor carrier pursuant to Docket No. MC#{Carrmc} (hereinafter referred to as Carrier) and {Broker}, (hereinafter referred to as Broker), a licensed property broker pursuant to Docket No. MC#{Brokermc}.

1. Broker is an agent authorized by its customers to negotiate and arrange for transportation of their shipments in interstate commerce.

1.1 Independent Contractor. Carrier understands and agrees that Carrier is an independent contractor of Broker, and that Carrier has exclusive control and direction of the work Carrier performs pursuant to this Agreement and each Transportation Schedule. Carrier agrees to assume full responsibility for the payment of all local, state, federal and intra-provincial payroll taxes, and contributions or taxes for unemployment insurance, worker’s compensation insurance, pensions, and other social security or related protection with respect to the persons engaged by Carrier for Carrier’s performance of the transportation and related services in a Transportation Schedule, and Carrier shall indemnify, defend and hold Broker, and its Customer harmless there from. Carrier shall provide Broker, with Carrier’s Federal Tax ID number and a copy of Carrier’s IRS Form W-9 prior to commencing any transportation or related services for Broker, under this Agreement.

2. Carrier shall transport a series of interstate shipments arranged by Broker pursuant to carrier load confirmation sheet(s) included herewith or subsequently incorporated by reference. (See Appendix A)

2.1 Carrier agrees to not back solicit any customer of Broker, either directly or indirectly. As liquidated damages, Carrier agrees to pay back a ten percent (10%) commission on all traffic handled by customers first introduced to Carrier by Broker for a period of one (1) year following cancellation of this Agreement.

3. Broker shall pay Carrier for services rendered in an amount equal to the rates and accessorial charges agreed to on Broker’s load rate confirmation sheet or other signed writing. Carrier must submit proof of delivery with invoices to Broker as agent for the shipper. Payment terms shall be thirty (30) days from receipt.

3.1 CARRIER agrees that BROKER is the sole party responsible for payment of CARRIER'S invoices and that, under no circumstance, will CARRIER seek payment from the shipper or consignee.

4.1 Carrier warrants to Broker (and its shipper’s principals) that it meets the following criteria: (a) Carrier shall maintain all risk cargo insurance in the amount of not less than ($100,000.00) per shipment; (b) Carrier shall maintain public liability insurance in the amount of not less that ($1,000,000) as required by federal regulation (BMC-91 on file); (c) Carrier shall maintain workers compensation insurance as required by state law; (d) Carrier shall agree to provide certificates of insurance upon request; (e) Carrier shall maintain satisfactory U.S. DOT safety ratings and is otherwise authorized to provide the proposed services; and (f) Carrier shall be in compliance with all applicable laws.
The above is the pure "Master template", and the application does everything related to this. There is no database involved, and no new files are written. As you can see, tags to be replaced are the following way
{requiredfield:inputtype:tagname:description}
requiredfield: is static and should not be changed
inputtype could be field or textarea, related to that a repsective input type is shown to the user
tagname defines the exact tag in the later text (to be replaced) for example if tagname would be "apple" all {apple} tags would be replaced with what the user enters for this field.
description shows the text in front of the input field, so the user knows what to enter there.

In Step 1:
The application reads the directory in which the above text is saved in, as .txt file, and creates a dropdown list of all files found in that directory (function createdropdown()). Once a user selects one form, a function reads the description out of this form (Function readdescription())

In Step 2:
The previously selected template which was posted to step2.php is saved as part of the Session, since it is requried later again. The application now uses this information, to scan the contract for all {requiredfield:......} tags, and regarding to that creates an input field for the use (function generatefields()), and on submit are posted with POST method.

In Step 3:
The application reads the template again, to determine what fields were sent from the last step, and checks if everything was filled out (function getfieldnames()). Then it presents the template with replaced tags in a textarea using the generatecontract() function.

The class:
PHP Code:

<?PHP

//Class to scan and read the contracts
class scancontract
{
    
//Read what contracts exist
    
public function createdropdown() 
    {
        
$op opendir("forms");
        
//Write all filenames in array "$dirs"
        
while(false !== ($filename readdir($op))) 
        {
            if(
$filename !== "config.cfg" && $filename !== "." && $filename !== "..")
            {
                
$file explode("."$filename);
                
$dirs[] = $file[0];
            }
        }
        
        
//Generate dynamic dropdown
        
foreach ($dirs as $contract)
        {
            if(
$_GET['descr'] == $contract)
            {
              echo 
"<option value=\"?descr=" $contract "\" selected=\"selected\">" $contract "</option>";
            }
            else
            {
              echo 
"<option value=\"?descr=" $contract "\">" $contract "</option>";
            }
        }
    }
    
    
//Read the description values out of a contract
    
public function readdescription($contract)
    {
        if (isset(
$contract) && !empty($contract))
        {
            
$file2read "forms/" $contract ".txt";
            
$fh fopen($file2read'r');
            
$filedata fgets($fh);
            
fclose($fh);
            if(
$filedata !== false)
            {
                
$descr1 explode("{description:"$filedata);
                
$descr2 explode(":description}"$descr1[1]);
                
$description $descr2[0];
                
                echo 
$description;
            }
        }
    }
    
    
//Function generates form fields requested for selected contract
    
public function generatefields($contract)
    {
        
$file2read "forms/" $contract ".txt";
        
$filedata file($file2read);
        if(
$filedata)
        {
            foreach (
$filedata as $line)
            {
                if(
strpbrk($line'{requiredfield:'))
                {
                    
$pt1 explode("{requiredfield:"$line);
                    
$cfg explode("}"$pt1[1]);
                    
$settings explode(":"$cfg[0]);
                    
                    if(!empty(
$settings[0]) && !empty($settings[1]) && !empty($settings[2]))
                    {
                    
                        if(
$settings[0] == "field")
                        {
                            echo 
"<tr><td>" $settings['2'] . ":</td>
                                  <td><input class=\"formstyle\" type=\"text\" name=\"" 
$settings['1'] . "\" /></td></tr>";
                        }
                        elseif(
$settings[0] == "textarea")
                        {
                            echo 
"<tr><td>" $settings['2'] . ":</td>
                                  <td><textarea cols=\"50\" rows=\"10\" name=\"" 
$settings['1'] . "\" class=\"contract\" /></textarea></td></tr>";
                        }
                        else
                        {
                            echo 
"<p class=\"error\">Error: No fieldtype specified in mastertemplate.</p>";
                            break;
                        }
                    }
                }
            }
        }
        else
        {
            echo 
"<p class=\"error\">Error: Could not read contract settings.</p>";
        }
    }
    
    
//Get Fieldnames for selected contract
    
public function getfieldnames($contract)
    {
        
$file2read "forms/" $contract ".txt";
        
$filedata file($file2read);
        if(
$filedata)
        {
            foreach (
$filedata as $line)
            {
                if(
strpbrk($line'{requiredfield'))
                {
                    
$pt1 explode("{requiredfield:"$line);
                    
$cfg explode("}"$pt1[1]);
                    
$settings explode(":"$cfg[0]);
                    
                    if(isset(
$settings[1]) && !empty($settings[1]))
                    {
                        
$fieldname[] = $settings[1];
                    }
                }
            }
            return 
$fieldname;
        }
        else
        {
            echo 
"<p class=\"error\">Error: Could not read field names.</p>";
        }
        
        
    }
    
    
//Generates final contract
    
public function generatecontract($contractname$postvalue)
    {
        
$filename "forms/" $contractname ".txt";
        
$handle fopen($filename"rb");
        
$contents fread($handlefilesize($filename));
        
fclose($handle);
        
        
        
//Remove all setting variables
        
$varcont preg_replace('/\{description:(.*):description\}/'''$contents);    
        
$text preg_replace('/\{requiredfield\:(.*)\}/'''$varcont);    
        
        
//Run through text as many times as necessary to replace all tags with dynamic content
        
foreach($postvalue as $tag)
        {
            
$tagvalue $_POST[$tag];
            
//Replace tags with dynamic content    
            
$text preg_replace('/\{'$tag .'\}/'$tagvalue$text);
            
$text preg_replace('/\\n\\n\\n/'""$text);
        }
        return 
$text;
    }

}
?>
If you would need it I could post the files of the seperate steps, but I think this should be enough.

Thanks so much for your help,
Max

Last edited by TenFormer; 03-03-08 at 11:06 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #6 (permalink)  
Old 03-03-08, 11:10 AM
TenFormer's Avatar
TenFormer TenFormer is offline
Newbie Coder
 
Join Date: Jan 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Oh one more side note, I tried to strip pretty much all \n characters out by

PHP Code:

$data explode("\n"$_POST['contract']); 

As far as I could see, that worked just great with this:
PHP Code:

foreach($data as $line)

{
     
//Generate new line in pdf here

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #7 (permalink)  
Old 03-03-08, 11:49 AM
mab's Avatar
mab mab is offline
Community VIP
 
Join Date: Oct 2005
Location: Denver, Co. USA
Posts: 2,674
Thanks: 0
Thanked 0 Times in 0 Posts
Your document contains curved quotes ’ “” instead of regular/straight quotes ' ".

What is probably happening is the curved quote characters are not present in the font you are using. I recommend editing the template to use straight quotes that would be present in most font sets.

Edit: See this link (about 1/2 way down the page) - http://en.wikipedia.org/wiki/Smart_quotes
__________________
Error checking, error reporting, and error recovery. If your code does not have these to get it to tell you why it is not working, what makes you think someone in a programming forum will be able to tell you why it is not working???

Last edited by mab; 03-03-08 at 11:51 AM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #8 (permalink)  
Old 03-03-08, 12:13 PM
TenFormer's Avatar
TenFormer TenFormer is offline
Newbie Coder
 
Join Date: Jan 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Hey,

I must say you are a true genious to have figured that out, really, thanks a lot.

Well it seems like the characters at least show up corretcly now, but my script somewhere puts a \ in front of them.
For example an apostrophe looks like this now:

Quote:
worker\'s
Did you happen to see where in the class it does that? Just wondering if you know, I will search through the code myself too.

Thank you soooo much,
Max
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #9 (permalink)  
Old 03-03-08, 12:25 PM
Nico's Avatar
Nico Nico is offline
Community Leader
 
Join Date: Sep 2005
Location: Spain
Posts: 8,074
Thanks: 11
Thanked 88 Times in 83 Posts
These slashes don't necessarily come from the class. PHP adds these automatically to $_POST/$_GET/$_COOKIE/$_ENV variables if magic_quotes_gpc is enabled in php.ini.

To remove them, you can either use stripslashes(), or preferably disable them in php.ini, as they're gonna be removed anyway in PHP 6.

Last edited by Nico; 03-03-08 at 12:46 PM. Reason: Typo.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #10 (permalink)  
Old 03-03-08, 03:39 PM
TenFormer's Avatar
TenFormer TenFormer is offline
Newbie Coder
 
Join Date: Jan 2007
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Yes, and again, perfect answer.
Works nice since I turned magic quotes off

I can across another problem though.
the § symbol does not show up correctly. Now I have seen that you can replace unlikely characters with special ones, but I do not understand what exactly is ment by this:

Quote:
The Euro character seems to be outside the normal character set, so you need to replace one of your 0->255 characters with it, using the options of the selectFont command (noting that these only work the first time that the function is called for each font). Here is an example which replaces the "!" character:
<?php
include ('class.ezpdf.php');

$pdf =& new Cezpdf('a4');


$euro_diff = array(33=>'Euro');
$pdf->selectFont('./fonts/Helvetica.afm',
array('encoding'=>'WinAnsiEncoding','differences'= >$euro_diff));

$pdf->ezText('**!!!!!!**',100,array('justification'=>'f ull'));

$pdf->ezText($pdf->messages,12);

if (isset($d) && $d){
$pdfcode = $pdf->ezOutput(1);
$pdfcode = str_replace("\n","\n<br>",htmlspecialchars($pdfcod e));
echo '<html><body>';
echo trim($pdfcode);
echo '</body></html>';
} else {
$pdf->ezStream();
}

?>

Note that this is most likely not the actual character that you wish to replace, but here is some information which was sent to me by "Balu":
Just for the reference (FAQ? :-), I've found more references about using the Euro in ASCII-Tables:

http://www.dragoman.org/euro/
replaces the "^"-char (0x5E) by the Euro-Symbol (U+20AC) and calls the new Table "Euro-ASCII"

http://lists.w3.org/Archives/Public/...7/01-euro.html
replaces the "|" (0x7C) by the Euro

http://www.alphaquark.com/Traduction/En_Euro.htm
replaces the ascii-char at 128 (0x80)

My Linux-console (vim + xxd) uses 0xa4...

Now I understand that basically I could replace a value of the font array, with another character with this line
PHP Code:

$euro_diff = array(33=>'Euro');

$pdf->selectFont('./fonts/Helvetica.afm',
        array(
'encoding'=>'WinAnsiEncoding','differences'=>$euro_diff)); 
But what I really do not get is, how to find out, which value represents what character, and especially what the name of this character would be.
Something like this???

PHP Code:

$euro_diff = array(33=>'Paragraph');

$pdf->selectFont('./fonts/Helvetica.afm',
        array(
'encoding'=>'WinAnsiEncoding','differences'=>$euro_diff)); 
And of course I would not want to replace the "!", since that is commonly needed, rather something very unlikely.

Thanks for the outstanding help,
Max
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
php code for convert html output to pdf vanisridesu PHP 3 01-16-07 05:57 AM
PDF Generation using PDFLIB raji20 PHP 0 11-29-06 02:17 AM
Generate pdf file with headers for printing zoliky Script Requests 1 11-16-06 05:56 AM
Creating PDF from HTML content? Alfarin PHP 0 07-24-06 07:48 AM
PDF file upload php4tric PHP 0 08-15-05 09:21 AM


All times are GMT -5. The time now is 12:05 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.