473,563 Members | 2,867 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 6302
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******@eminen t.demon.co.uk.n ot.this.bit.no. html
2 Tees Close, Witham, Essex.
Gravity beer in Essex <http://www.eminent.dem on.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*********@sbc global.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******** *****@individua l.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
5450
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 characters: CheckPrintable(self,message): printablemessage = ""
3
1329
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
1818
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 bunch of fields in my application (winforms) which the user can select to include in the report or not. I believe I can use the CR Engine to change...
7
5952
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 details invovling that computer, for the user to then view. Any ideas on some code? Many thanks for any help.
1
2252
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 equipment from a list of parts. I kind of need a form which lists parts and then check boxes next to a part can be created so the user can select...
2
9172
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
3656
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 haven't decided what the best way to do this is because I don't have much experience with generating printable forms. Early on I knew one of my...
3
1999
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, similar to creating one with MS Word. We have Access tables and want to create a healthcare provider directory. Table has ~30,000 records. We'd...
0
1500
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 attached to a table - these forms are typically designed for user interface face stuff like prompts, print buttons etc). The following screen shots are...
0
7665
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7888
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7642
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7950
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5484
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
3643
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
1
2082
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1200
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
924
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...

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.