This discussion is archived
13 Replies Latest reply: Dec 1, 2012 7:02 AM by Andreas Weiden RSS

Saved pre-printed .doc or pdf letter.

846231 Newbie
Currently Being Moderated
Hi all,

Apex 4.0 & 4.1

I have a pre-printed letter.doc template which is sent to client who have overdue billing account.

The variable field in this letter are DATE, NAME, BILLING_ADDRES, & AMOUNT, which are pulled out from the billing table.

Is Apex capable of saving templates docs/pdf for billing purposes?


Thanks a lot,
Kinz

Edited by: KinsaKaUy? on 28-Nov-2012 21:03
  • 1. Re: Saved pre-printed .doc or pdf letter.
    846231 Newbie
    Currently Being Moderated
    Hello all,

    I just want for confirmation if this can be done only using BI-Publisher? and not Apex? or can I integrate them?


    Thanks,
    Kinz
  • 2. Re: Saved pre-printed .doc or pdf letter.
    TexasApexDeveloper Guru
    Currently Being Moderated
    You can accomplish this using rtf files and APEX or using BI Publisher and APEX.. What is your preference?

    There is an existing example from a while back that used substitution variables and an RTF file stored in a table to accomplish this.. Or ou could take you Word doc and using BI Publisher create a template to use in APEX..

    Your choice...

    Thank you,

    Tony Miller
    Ruckersville, VA
  • 3. Re: Saved pre-printed .doc or pdf letter.
    matthew_morris Expert
    Currently Being Moderated
    I have integrated Apex and a free PDF tool (PDFTK -- http://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/) to fill in PDF forms from an Apex application.
  • 4. Re: Saved pre-printed .doc or pdf letter.
    846231 Newbie
    Currently Being Moderated
    Thanks tony,

    Maybe I wanted the free one, coz bi-publisher is not. How can I find that sample you mentioned :(
  • 5. Re: Saved pre-printed .doc or pdf letter.
    846231 Newbie
    Currently Being Moderated
    Thanks mat,

    Is there available OBE, demo, tutorial for this task?
  • 6. Re: Saved pre-printed .doc or pdf letter.
    matthew_morris Expert
    Currently Being Moderated
    Is there available OBE, demo, tutorial for this task?
    Nope. This is something I developed on my own -- not a 'Code by Google' special. It wasn't a cakewalk to build, but not extraordinarily difficult either. PDFTK uses FDF files to fill forms. FDF files are text-based, and so can be manipulated by PL/SQL. They contain the field name (i.e. 'FIRST_NAME'), and the value to be placed into that field. I create an FDF 'template' with the fields filled in with formatted replacement text (i.e. '#FIRST_NAME#'). This, along with the unfilled PDF form are saved to a directory accessible to Oracle. The actual 'code' process performs the following steps:

    1. My PDF 'printing' package will load the template FDF into a VARCHAR2 variable.
    2. It replaces all of the form-field variables (i.e. REPLACE '#FIRST_NAME#' with 'Matthew')
    3. The result is saved to a 'Filled' FDF file in the same directory.
    4. I call PDFTK via a host call to combine the blank PDF with the filled FDF into a 'filled' PDF.
    5. I then mail the filled PDF to the person calling the package.

    All of the files use a naming convention to make the process generic based on a parameter passed to the package with the report name.

    [REPORT_NAME]_unfilled.pdf
    [REPORT_NAME]_template.fdf
    [REPORT_NAME]_filled.fdf
    [REPORT_NAME]_filled.pdf
  • 7. Re: Saved pre-printed .doc or pdf letter.
    TexasApexDeveloper Guru
    Currently Being Moderated
    Here is the link to the application.. Be aware it is from the HTML-DB version of APEX and you MIGHT want to spruce it up... Along wit the fact there is a limit of so many characters with RTF..

    https://apex.oracle.com/pls/otn/f?p=18326:44:13480660697906::::P44_ID:1682

    Thank you,

    Tony Miller
    Ruckersville, VA
  • 8. Re: Saved pre-printed .doc or pdf letter.
    846231 Newbie
    Currently Being Moderated
    Hi Tony,

    Is the download site and file still available? I got error "500 - Internal Server Error" when I download it :(

    Hi Mat,

    Is the link given by Tony same process you have done? or which of the two is easier and better? effective & efficient ? :)

    Can you try it here please....

    http://apex.oracle.com/pls/apex/f?p=4500:1000:34907061193782

    ws: dev_ws_100
    user: test01
    passwd:abc123


    Thanks a lot,
  • 9. Re: Saved pre-printed .doc or pdf letter.
    Scott Oracle ACE Director
    Currently Being Moderated
    Wow, talk about a trip down memory lane. I created the solution that Tony referenced back when I was working at Oracle round 2003-4 or so. I would not recommend using it today, even if the link did work, as it was based on a specific version of WordPad that was only available with Windows XP.

    One low-cost alternative to have a look at is PL/PDF. You can upload any form as a template, and then use PL/PDF to fill in the blanks, so to speak. It takes a little getting used to it, but once you understand how it works, it can be quite a powerful tool. Have a look here: http://www.plpdf.com

    Thanks,

    - Scott -

    http://spendolini.blogspot.com
    http://www.enkitec.com
  • 10. Re: Saved pre-printed .doc or pdf letter.
    846231 Newbie
    Currently Being Moderated
    Thanks Scott :)

    I will check it asap, is this a freeware?

    Edited by: KinsaKaUy? on 28-Nov-2012 21:00
  • 11. Re: Saved pre-printed .doc or pdf letter.
    matthew_morris Expert
    Currently Being Moderated
    Is the link given by Tony same process you have done?
    Nope. Completely different animals.

    ...or which of the two is easier and better? effective & efficient ?
    Of the options listed in this thread, PL/PDF is probably easiest and most flexible. The only thing my method has to offer is that is it completely free since PDFTK is freeware. Since you have to write the interface on your own to use it, making use of PDFTK will be harder to implement. Filling in PDF forms is very much a minor (albeit handy) feature of my apps. It automates some functionality that used to be performed manually by our billing team. I wasn't sure when I started that I would be able to get PDFTK to do what I wanted... but I like challenges. :)
  • 12. Re: Saved pre-printed .doc or pdf letter.
    TexasApexDeveloper Guru
    Currently Being Moderated
    Scott,
    Just meant as a starting point. Using the rtf files for reporting was just an idea...

    Thank you,

    Tony Miller
    Ruckersville, VA
  • 13. Re: Saved pre-printed .doc or pdf letter.
    Andreas Weiden Guru
    Currently Being Moderated
    There is also a free alternative which generates PDF based on Jasper-Report jrxml-definitions. Might fulfil your requirements. http://sourceforge.net/projects/pljrxml2pdf/

    You can also try it online http://apex.oracle.com/pls/apex/f?p=13767

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points