473,385 Members | 1,983 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Dynamic PDF Generation of HTML using PHP

Hi,

I am looking for php tools / scripts with which I can convert php
generated HTML to PDF. I was looking at FPDF and HTML2PDF (based on
FPDF). However, HTML2PDF can not handle nested lists and the output is
wrong. If I generate a PDF from:

<ul>
<li>L1</li>
<li>L2</li>
<ul>
<li>SL1</li>
</ul>
<li>L3</li>
</ul>

the ouput looks like:

- L1
- SL1
- L4

Maybe I did something wrong, but I could not find any error. Does
anybody know free php libraries cabable of handling nested lists?

Thanks a lot,

-- Frank

Apr 25 '06 #1
2 4238
correction:

the output is:

- L1
- SL1
- L3

instead of

- L1
- L2
- SL1
- L3

-- Frank

Apr 25 '06 #2
This from fpdf fourm...

Author: Muhammad Azeem Abbas (---.net.pk)
Date: 09-17-05 06:31

Use PHP str_replace(); Function before passing your HTML Tags to PDF.
Write

$html = str_replace( '<ul>', "" , $html );
$html = str_replace( '<li>', "->" , $html );
$html = str_replace( '</li>', "\n" , $html );
$html = str_replace( '</ul>', "" , $html );

Replace <li> tag with any character that shows a bullet, and replace
</li> to a new line.

HIH

Apr 25 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Marco Loskamp | last post by:
Dear list, I'm trying to dynamically generate functions; it seems that what I really want is beyond C itself, but I'd like to be confirmed here. In the minimal example below, I'd like to...
7
by: Venus | last post by:
Hello, I am trying to generate a dynamic form at runtime and would like to do it using "<asp: ..." form elements as follows Build up the string that is placed somewhere in the HTML code the...
4
by: Venus | last post by:
Hello, Thanks for your reply. I understand that a control can be created dynamically in several ways: 1) using StringBuilder 2) using Controls.Add 3) using ASP PlaceHolder But this is just...
0
by: Venus | last post by:
Hello, After trying some ways to do it I wanted to use something like the code below but for some reason is not working (I have to generate the entire form dynamically (not only the controls)):...
5
by: Wayne | last post by:
I have a way for doing plugin's in my gui app. These plugins have to talk to a webservice to do database calls. I've done the DB access as a web service so it can be shared with the rest of the...
2
by: Ghada Al-Mashaqbeh via DotNetMonster.com | last post by:
Hi all, I am facing a problem in dynamic code generation at run time, the problem occurs when the dynmaic code use global data exist within the original application. Lets say that my...
5
by: pittendrigh | last post by:
There must be millions of dynamically generated html pages out there now, built by on-the-fly php code (and jsp, perl cgi, asp, etc). Programatic page generation is transparently useful. But...
7
by: dino d. | last post by:
Hi- I want to create a dynamic image with areas so that when the user clicks different areas, the user jumps to those pages. The problem is, I can't seem to figure out how to do this efficiently....
3
by: Brunda | last post by:
Hi, I have some doubts 1) Can some one explain the difference b/w include_once and require_once 'coz there are some instances when we use include_once() and the code works and in same case...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.