Solved

PDF generation using PHP

Posted on 2004-09-29
3
745 Views
Last Modified: 2008-03-10
Hello,

Iam using "ezpdf" for creating pdf doc.
here is the url.

on the second page i use the base class function "addTextWrap" for writing rotated text.
but this does not maintain the text formatting such as line breaks,

there is a function  
function ezProcessText($text){
  // this function will intially be used to implement underlining support, but could be used for a range of other
  // purposes
  $search = array('<u>','<U>','</u>','</U>');
  $replace = array('<c:uline>','<c:uline>','</c:uline>','</c:uline>');
  return str_replace($search,$replace,$text);
}

which i think is used for underlining text in pdf format..

so is there any tag like <c:uline> for line breaks in PDF?

0
Comment
Question by:sandeepaher
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 27

Expert Comment

by:Diablo84
ID: 12178945
I would imagine pdf's recognise the \n as new line so try

function ezProcessText($text){
  // this function will intially be used to implement underlining support, but could be used for a range of other
  // purposes
  $search = array('<u>','<U>','</u>','</U>');
  $replace = array('<c:uline>','<c:uline>','</c:uline>','</c:uline>');
  $text = str_replace($search,$replace,$text);
  $text = str_replace("<br>","\n",$text);
  return $text;
}

not 100% sure on that one
0
 

Author Comment

by:sandeepaher
ID: 12179005
\n
this doesnt work.

 is there any tag like <c:uline> for line breaks in PDF?
0
 
LVL 27

Accepted Solution

by:
Diablo84 earned 500 total points
ID: 12180338
Not that i am aware of if \n does not work.

I have just had a quick look through the class file, prehaps you can work around the problem by using effective paragraphing, that is to say making multiple calls to the function that adds text to the pdf, ezText. I haven't looked at this package before today so whether or not this is feasible i cannot say for sure, prehaps the folks in the Acrobat Reader TA would be able to shed some light on how PDF's handles line breaks.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article discusses four methods for overlaying images in a container on a web page
Many old projects have bad code, but the budget doesn't exist to rewrite the codebase. You can update this code to be safer by introducing contemporary input validation, sanitation, and safer database queries.
Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
The viewer will learn how to create a basic form using some HTML5 and PHP for later processing. Set up your basic HTML file. Open your form tag and set the method and action attributes.: (CODE) Set up your first few inputs one for the name and …

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question