473,386 Members | 1,791 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,386 software developers and data experts.

Creating a printable report simply, rtf or PDF

Any thoughts in the newsgroup?

Over Christmas I produced, using PHP and MySQL, a database and front end to
record my familys family tree with a short biography and linked photos and
locations if desired. All this works fairly well.

However, as a followup I'd like to create a report this data as a report (or
booklet) in printed format. The simplest and probably least satisfactory
way is to format it in very simple HTML and import it into the word
processor of choice.

Better ways I assume are to export it in PDF or RTF. I am veering toward
RTF.

PDF - pros:

Probably the neatest solution from a user point of view.
PDF - cons:

PHP was not compliled on my Slackware 10.0 linux system with the pdf
functions working.

My parents are running XP home, I doubt if phpdev5 (beta) has the same pdf
functions compliled in.

Basically I don't want to go through the rigmarole of recompiling php on two
dissimilar systems.

I could generate XLS-FO directly, then use FOP to generate PDF. I would
probably spend a lot of time getting this to work under two separate
systems, and have to get java working on XP. Hastle if I am not all that
familiar with java.

I could create a DTD, get my script to produce XML and then use a template
and something like sablotron to generate XML. That seems like a
sledgehammer to crack a nut. Also, I must be getting the wrong end of the
stick with XML, as last time I tried it created far far more work than it
saved. Saving effort seems to be a large point of XML.
RTF - pros:

Since this is basically one step from hand coding, using my script to
directly generate rtf is relatively self contained and therefore not
dependent on successfully installing a lot of other stuff.

RTF - cons:

I've still not managed to add images to RTF.

RTF is horrid, wrt to human readability of what my scripts are generating,
making debugging rather nasty.

Even if it works now in open office and word I have no way of knowing I have
not created broken RTF that future word processors might balk at.

Any thoughts?

Pete


--
http://www.petezilla.co.uk
Jan 7 '06 #1
5 6288
Following on from Peter Chant's message. . .
Any thoughts in the newsgroup?

Over Christmas I produced, using PHP and MySQL, a database and front end to
record my familys family tree with a short biography and linked photos and
locations if desired. All this works fairly well.

However, as a followup I'd like to create a report this data as a report (or
booklet) in printed format. The simplest and probably least satisfactory
way is to format it in very simple HTML and import it into the word
processor of choice.

Better ways I assume are to export it in PDF or RTF. I am veering toward
RTF.

Your analysis of technologies is reasonable. You have carefully listed
the features of solutions... ...but where have you listed the features
you'd like to see in the problem? Aha!

Let me guess and we'll go from there:
(1) Great Aunt Maude can be viewed using a web browser but 'wouldn't it
be nice if there was a nicely produced printed version with all the
story for presentation around the further arms of the family and those
who prefer paper.
(2) As the work is new as stands it will go through a process of "you've
left out..." and "That's not uncle Charlie but uncle Fred..." and so on.

As it happens, to produce an 'heirloom quality' copy you will need to do
word processing. Pages will get split badly, some will want to be
landscape and there's the matter of an index. Also a book would not be
just a catalogue of people one to a page etc but a family history where
the narrative aspect doesn't fit too well with the snapshot model used
by web pages.

So _for a final-finished_ version you'll need a way to export your data
to a word processor. Text or RTF would do the job. If you were to try
direct to PDF you'd be forever fiddling with formatting. It is possible
to stitch together PDF pages from different sorts into a whole but that
costs £££ unless you have Adobe Acrobat (Writer) or Pagemaker installed
already.

But as you are not yet at the 'book of family history' stage can get a
long way by the very simple expedient of a bit of CSS and a big report
(web) page which then gets 'printed' to PDF for paper use. In this you
want to be strict about the simplicity of your HTML then use CSS to
tweak layout and prettyfication. This means that you have a way to
create an up-to-date paper version as requests come in but not get
involved with fixing everything in a word processed book.

BTW : The above is written from personal experience of a Family History
project although no PHP or CSS was involved.


--
PETER FOX Not the same since the icecream business was liquidated
pe******@eminent.demon.co.uk.not.this.bit.no.html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.demon.co.uk>
Jan 7 '06 #2
Peter Fox wrote:
Your analysis of technologies is reasonable. You have carefully listed
the features of solutions... ...but where have you listed the features
you'd like to see in the problem? Aha!
You are stating I should have asked a bigger question.

Let me guess and we'll go from there:
(1) Great Aunt Maude can be viewed using a web browser but 'wouldn't it
be nice if there was a nicely produced printed version with all the
story for presentation around the further arms of the family and those
who prefer paper.
I am at the ztage where Aunt Maud (no actual Maud so far) can be viewed on
the browser. I list her parents, grandparents, spouse, siblings and
children. I've left grand-children for now to keep it simple. I can also
list places associated with her and give explantory text, including
headings and photos. Formatting for photos is a little poor so far as I
only store the photos at one resolution. I really ought to store them at a
higher resolution for producing copies and then use php, imagemagick or
whatever to reduce them to a sensible size for the screen.
(2) As the work is new as stands it will go through a process of "you've
left out..." and "That's not uncle Charlie but uncle Fred..." and so on.

I'm not missing many. I've got around 100 relations entered, going back as
far as my great-great-grandparents. Given that my family is generally long
lived and some at least don't rush into having children I'm back to the
1830s as the earlist dates of birth. I doubt if there is much interest in
going any earlier, as we have no photos or documentary evidence reaching
farther back than that.

Actually rather than untra-neat presentation I'm more into recording who's
who on various family photos and any significant points to note. The
family tree (ish, I'm working backwards) is useful to show me exactly what
relations my parents are talking about.

The information is more important, it would have been useful to do this
years back, before both my grandmothers had died. The presentation can be
tweaked any time.
As it happens, to produce an 'heirloom quality' copy you will need to do
word processing. Pages will get split badly, some will want to be
landscape and there's the matter of an index. Also a book would not be
just a catalogue of people one to a page etc but a family history where
the narrative aspect doesn't fit too well with the snapshot model used
by web pages.

I'm not sure if I'm going to go to the length of 'heirloom quality'. Just
reproducing photos in an album, having a document with a potted history and
a guide to who is in the photos would be very valuable.

Actually, it does raise the point, laser printed text on paper should last a
while, as should ugly laser printed halftoned photos. There is much debate
over the longevity of inkjet photos. Maybe I should produce the copies of
the photos on black and white photo-paper and use laser printed photos for
a key of who is who.

For indexing I could simply use sections and paragraph numbers as these are
independent of pages. I.e:

1. Introduction
2. Family trees (i.e. drawn somehow)
3. People
3.1 Tom
3.2 Dick
3.3 Harry
4. Locations

Fairly easy to do contents like this with a script.

So _for a final-finished_ version you'll need a way to export your data
to a word processor. Text or RTF would do the job. If you were to try
direct to PDF you'd be forever fiddling with formatting. It is possible
to stitch together PDF pages from different sorts into a whole but that
costs £££ unless you have Adobe Acrobat (Writer) or Pagemaker installed
already.

I note the words 'final finished'.

I don't think that PDF is a good format for anything but viewing/printing or
emailing formatted documents, for which I find it very useful.

I would like to crack how to embed photos in RTF as I failed to do this last
time I tried.

But as you are not yet at the 'book of family history' stage can get a
long way by the very simple expedient of a bit of CSS and a big report
(web) page which then gets 'printed' to PDF for paper use. In this you
want to be strict about the simplicity of your HTML then use CSS to
tweak layout and prettyfication. This means that you have a way to
create an up-to-date paper version as requests come in but not get
involved with fixing everything in a word processed book.
I wonder if this imports the photos? I'm not sure if saving the page and
reloading it would work. However, I just tried a copy from Firefox pasted
into OpenOffice. That worked fine.

BTW : The above is written from personal experience of a Family History
project although no PHP or CSS was involved.


Cheers for your insight.

--
http://www.petezilla.co.uk
Jan 7 '06 #3
> I would like to crack how to embed photos in RTF as I failed to do this last
time I tried.


I took the time to go and look up the RTF codes for embedding images for
you. You can find them at the following URL:

http://www.biblioscape.com/rtf15_spec.htm#Heading49

I'm sure you know about all the codes, as you have to output other codes
for the RTF header and formatting, etc. The link above will show you
the RTF codes for embedding an image. You will just have to attatch
your image inline as hex or binary format.
Jan 7 '06 #4
jo*********@sbcglobal.net wrote:
I would like to crack how to embed photos in RTF as I failed to do this
last time I tried.


I took the time to go and look up the RTF codes for embedding images for
you. You can find them at the following URL:

http://www.biblioscape.com/rtf15_spec.htm#Heading49

I'm sure you know about all the codes, as you have to output other codes
for the RTF header and formatting, etc. The link above will show you
the RTF codes for embedding an image. You will just have to attatch
your image inline as hex or binary format.


Cheers for that. I did not manage to come up with much when I searched
myself. I have managed to output RTF files, including tables, before.
It's just the images that I have not managed. It looks like I could have
hours of endless fun with images!
Pete

--
http://www.petezilla.co.uk
Jan 8 '06 #5
Greetings from a fellow genealogist.

Have a look at this site: http://www.phpclasses.org/

There are a few RTF generators available there, although I have not tried
any of them myself.

Good luck with the research!

Katipo
"Peter Chant" <pe**@petezilla.co.uk> wrote in message
news:42*************@individual.net...
Any thoughts in the newsgroup?

Over Christmas I produced, using PHP and MySQL, a database and front end
to
record my familys family tree with a short biography and linked photos and
locations if desired. All this works fairly well.

However, as a followup I'd like to create a report this data as a report
(or
booklet) in printed format. The simplest and probably least satisfactory
way is to format it in very simple HTML and import it into the word
processor of choice.

Better ways I assume are to export it in PDF or RTF. I am veering toward
RTF.

PDF - pros:

Probably the neatest solution from a user point of view.
PDF - cons:

PHP was not compliled on my Slackware 10.0 linux system with the pdf
functions working.

My parents are running XP home, I doubt if phpdev5 (beta) has the same pdf
functions compliled in.

Basically I don't want to go through the rigmarole of recompiling php on
two
dissimilar systems.

I could generate XLS-FO directly, then use FOP to generate PDF. I would
probably spend a lot of time getting this to work under two separate
systems, and have to get java working on XP. Hastle if I am not all that
familiar with java.

I could create a DTD, get my script to produce XML and then use a template
and something like sablotron to generate XML. That seems like a
sledgehammer to crack a nut. Also, I must be getting the wrong end of the
stick with XML, as last time I tried it created far far more work than it
saved. Saving effort seems to be a large point of XML.
RTF - pros:

Since this is basically one step from hand coding, using my script to
directly generate rtf is relatively self contained and therefore not
dependent on successfully installing a lot of other stuff.

RTF - cons:

I've still not managed to add images to RTF.

RTF is horrid, wrt to human readability of what my scripts are generating,
making debugging rather nasty.

Even if it works now in open office and word I have no way of knowing I
have
not created broken RTF that future word processors might balk at.

Any thoughts?

Pete


--
http://www.petezilla.co.uk

Jan 8 '06 #6

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

Similar topics

2
by: Daniel Alexandre | last post by:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Hi there, I'm using the following method in my program to check whether a message received is printable or not and to strip the non-printable...
3
by: Rod | last post by:
I want to produce some reports designed for printing. (like you can in Access). I can't find the equivalent, what's the accepted way of achieving something similar. many thanks Rod
3
by: puunda | last post by:
Hi, Hope I've posted to the right groups. I'm trying create a Crystal Report for the first time using C# (novice at that as well). The CR I can handel. What I want to do is to have a whole...
7
by: Simon Bailey | last post by:
How do you created a query in VB? I have a button on a form that signifies a certain computer in a computer suite. On clicking on this button i would like to create a query searching for all...
1
by: James | last post by:
I am creating a system whereby equipment is inspected. Data is inputted into an inspection form. However, any equipment that is not satisfactory needs to have spare parts ordered for that piece of...
2
by: Sami | last post by:
Could someone explain clearly how to go about doing this? I have tried setting up the structure on numerous occasions, but it never seems to work. Could someone please help me out? Thanks!
4
by: sklett | last post by:
I've developed an ERP application that we use internally and works quite well. I receiving more and more requests from users to print various transactions, order forms, search results, etc. I...
3
by: veaux | last post by:
Adobe has WAY to many forums and I wasn't sure which was correct so thought I'd try here first. I'm trying to see if there is a product that will allow us to create a large (1,100 pg) directory,...
0
by: Albert D. Kallal | last post by:
Use the "where" clause, and make the reports sql *without* any parameters..and you not need to change the params.. So, you can build a un-bound form (a un-bound form is a form that is NOT...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.