?
Solved

PDF generation using PHP

Posted on 2004-09-29
3
Medium Priority
?
747 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 1500 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

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

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

Author Note: Since this E-E article was originally written, years ago, formal testing has come into common use in the world of PHP.  PHPUnit (http://en.wikipedia.org/wiki/PHPUnit) and similar technologies have enjoyed wide adoption, making it possib…
This article discusses how to implement server side field validation and display customized error messages to the client.
The viewer will learn how to count occurrences of each item in an array.
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 …
Suggested Courses

771 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