Creating a printable report simply, rtf or PDF

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Chant

    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




    --

  • Peter Fox

    #2
    Re: Creating a printable report simply, rtf or PDF

    Following on from Peter Chant's message. . .[color=blue]
    >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.[/color]
    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
    peterfox@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>

    Comment

    • Peter Chant

      #3
      Re: Creating a printable report simply, rtf or PDF

      Peter Fox wrote:[color=blue]
      > 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![/color]

      You are stating I should have asked a bigger question.
      [color=blue]
      >
      > 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.[/color]

      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.
      [color=blue]
      > (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.
      >[/color]

      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.


      [color=blue]
      > 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.
      >[/color]

      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.

      [color=blue]
      > 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.
      >[/color]

      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.

      [color=blue]
      > 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.[/color]

      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.
      [color=blue]
      >
      > BTW : The above is written from personal experience of a Family History
      > project although no PHP or CSS was involved.
      >[/color]

      Cheers for your insight.

      --

      Comment

      • john.d.mann@sbcglobal.net

        #4
        Re: Creating a printable report simply, rtf or PDF

        > I would like to crack how to embed photos in RTF as I failed to do this last[color=blue]
        > time I tried.[/color]

        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:



        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.

        Comment

        • Peter Chant

          #5
          Re: Creating a printable report simply, rtf or PDF

          john.d.mann@sbc global.net wrote:
          [color=blue][color=green]
          >> I would like to crack how to embed photos in RTF as I failed to do this
          >> last time I tried.[/color]
          >
          > 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.[/color]

          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



          --

          Comment

          • Katipo

            #6
            Re: Creating a printable report simply, rtf or PDF

            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" <pete@petezilla .co.uk> wrote in message
            news:428ellF1hc ahhU1@individua l.net...[color=blue]
            > 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[/color]


            Comment

            Working...