[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

PDF generation using PHP

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

Ready to improve network connectivity? Watch this webinar to learn how SD-WANs and a one-click instant connect tool can boost provisions, deployment, and management of your cloud connection.

Question has a verified solution.

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

Popularity Can Be Measured Sometimes we deal with questions of popularity, and we need a way to collect opinions from our clients.  This article shows a simple teaching example of how we might elect a favorite color by letting our clients vote for …
This article discusses four methods for overlaying images in a container on a web page
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn how to look for a specific file type in a local or remote server directory using PHP.
Suggested Courses

649 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