PL/PDF - Procedure template Example

Hellow All,
I have Oracle XE 10g with Oracle Apex and I installed PL/PDF in the same. I tried to execute the template procedure given in the installation guide. But it prints template only for 1st page.How to print template for others pages.
- create template procedure
CREATE OR REPLACE package template_eg is
/* 50. Example: Templates */
procedure template_init;
procedure template_eg;
end;
CREATE OR REPLACE package body template_eg is
/* The template */
v_tpl plpdf_type.tr_tpl_data;
/* Prepare template PDF */
procedure template_init is
l_pdf blob;
begin
/* Select template PDF*/
select t.orig_pdf
into l_pdf
from plpdf_template t
where id = 1;
/* Parsing data */
v_tpl := plpdf_parser.GetTemplate(
p_blob => l_pdf,
p_page_id => 1
end;
/* Procedure which use the template page */
procedure template_eg is
l_blob blob;
l_tpl_id number;
begin
/* Initialize template document */
template_init;
/* Initialize, without parameters means:
- page orientation: portrait
- unit: mm
- default page format: A4 */
plpdf.init;
/* Insert a template into the pdf.
Return: Template ID */
l_tpl_id := plpdf.InsTemplate(
p_tpl => v_tpl -- Template data
/* Begin a new page, without parameters means:
- page orientation: default (portrait) */
plpdf.NewPage;
/* Use a template. */
plpdf.useTemplate(
p_tplidx => l_tpl_id -- Template ID
/* Sets the font and its properties */
plpdf.SetPrintFont(
p_family => 'Arial', -- Font family: Arial
p_style => null, -- Font style: regular (default)
p_size => 12 -- Font size: 12 pt
/* Draws a rectangle cell with text inside.
The rectangle may have a border and fill color specified. */
plpdf.PrintCell(
p_w => 50, -- Rectangle width
p_h => 10, -- Rectangle heigth
p_txt => 'Template Example' -- Text in rectangle
plpdf.NewPage;
/* Draws a rectangle cell with text inside.
The rectangle may have a border and fill color specified. */
plpdf.PrintCell(
p_w => 50, -- Rectangle width
p_h => 10, -- Rectangle heigth
p_txt => 'Template Example' -- Text in rectangle
/* Returns the generated PDF document.
The document is closed and then returned in the OUT parameter. */
plpdf.SendDoc(
p_blob => l_blob -- The generated document
/* Print it:*/
owa_util.mime_header('application/pdf',false);
htp.p('Content-Length: ' || dbms_lob.getlength(l_blob));
owa_util.http_header_close;
wpg_docload.download_file(l_blob);
end;
end; -- End of package template_eg
Thanks.

Bhushan,
Did you ever solve this question?
I am thinking of using this feature but want to avoid pitfalls like this.
Thanks,
Stew

Similar Messages

  • PL/PDF  - Procedure template

    Hello All,
    I have Oracle XE 10g with Oracle Apex and recently I installed PL/PDF in the same. I tried to execute the template procedure given in the installation guide. But it does not print data in template procedure after printing the template. How can I get the data from template procedure?
    The template_eg procedure is not not printing "Template Example".
    - create template procedure
    CREATE OR REPLACE package template_eg is
    /* 50. Example: Templates */
    procedure template_init;
    procedure template_eg;
    end;
    CREATE OR REPLACE package body template_eg is
    /* The template */
    v_tpl plpdf_type.tr_tpl_data;
    /* Prepare template PDF */
    procedure template_init is
    l_pdf blob;
    begin
    /* Select template PDF*/
    select t.orig_pdf
    into l_pdf
    from plpdf_template t
    where id = 1;
    /* Parsing data */
    v_tpl := plpdf_parser.GetTemplate(
    p_blob => l_pdf,
    p_page_id => 1
    end;
    /* Procedure which use the template page */
    procedure template_eg is
    l_blob blob;
    l_tpl_id number;
    begin
    /* Initialize template document */
    template_init;
    /* Initialize, without parameters means:
    - page orientation: portrait
    - unit: mm
    - default page format: A4 */
    plpdf.init;
    /* Insert a template into the pdf.
    Return: Template ID */
    l_tpl_id := plpdf.InsTemplate(
    p_tpl => v_tpl -- Template data
    /* Begin a new page, without parameters means:
    - page orientation: default (portrait) */
    plpdf.NewPage;
    /* Use a template. */
    plpdf.useTemplate(
    p_tplidx => l_tpl_id -- Template ID
    /* Sets the font and its properties */
    plpdf.SetPrintFont(
    p_family => 'Arial', -- Font family: Arial
    p_style => null, -- Font style: regular (default)
    p_size => 12 -- Font size: 12 pt
    /* Draws a rectangle cell with text inside.
    The rectangle may have a border and fill color specified. */
    plpdf.PrintCell(
    p_w => 50, -- Rectangle width
    p_h => 10, -- Rectangle heigth
    p_txt => 'Template Example' -- Text in rectangle
    /* Returns the generated PDF document.
    The document is closed and then returned in the OUT parameter. */
    plpdf.SendDoc(
    p_blob => l_blob -- The generated document
    /* Print it:*/
         owa_util.mime_header('application/pdf',false);
    htp.p('Content-Length: ' || dbms_lob.getlength(l_blob));
    owa_util.http_header_close;      
    wpg_docload.download_file(l_blob);
    end;
    end; -- End of package template_eg
    Thanks.

    Although I am not familiar with this pl/pdf example, I can see that that nowhere in this procedure is any data selected to be printed on the template.
    You would expect something like
    select empno, ename from emp
    to select data to be printed on the template. It looks like your procedure just prints the template, but does not put any data on it. Correct?

  • PDF form template displaying multiple sets of data loaded from xfdf

    Hello
    I would like to use PDF Forms with data stored in xfdf files.
    Is it possible to create pdf form (template) for displaying and printing multiple sets of data stored in xfdf?
    For example: pdf form contains 2 sets of data. Form field names:  F_1 and F_2.
    I have 7 sets od data. All I need is to create pdf and xfdf that can be displayed in PDF reader and printed
    as document consisting of 4 the same pages containing different data in form fields loaded from xfdf file.
    (something similar to Mail merge in MS Office Word).
    How it would be done? Is it possible to make such pdf, xfdf?
    If yes, where I can find examples (tutorial) of creating such forms, please?
    Thanks.
    J. Jas

    It is possible but not just a simple import of data.
    Each form field in the multiple page PDF would need a unique name not repeated on another page of the PDF. Fortunately the Acrobat form standard includes the "template" object and this object can be spawned or used to add a new page with the form fields automatically renamed with a prefix string of the page number and template added to each form field on the new page. So if one were to import a row from your tab delimited file into the template, one could then spawn a new page from the template with the data and rename the fields so there would be no conflict of like named fields.
    A Lesson in Templates for Adobe Acrobat by Dave Wraight
    With newer versions of Acrobat there is a mail merge feature.
    Create PDFs from Word mail merges

  • PDF Sub templates.

    Hi all,
    I have just created an XSL-FO template from where I want to import a PDF sub-template.
    When I try to import the sub-template, I get the following error:
    java.io.UTFDataFormatException: Invalid UTF8 encoding.
    Can anyone help me resolve this issue?
    BR Kennth

    How to call a rtf template from another rtf template by passing a value try in main template create hyperlink of url with parameters for another template
    http://bipconsulting.blogspot.ru/2010/02/drill-down-to-detail-or-another-report.html
    When user pull a quote report from siebel this new rtf template should attach to the quote at the end.it'll be only another report
    IMHO you can not attach it to main. it'll be second independent report
    you can try subtemplate but it's not about rtf from rtf by click
    it's about call automatically rtf subtemplate from main rtf based on some conditions
    for example, main template contain some data and if some condition is true then call subtemplate and place it instead of its condition

  • How to generate PDF from template via REST query

    Hello. I'm newbie in Adobe LiveCycle, will appreciate any help.
    What we need: generate PDF from template, using different data.
    What we have: LiveCycle Designer and server with deployed Adobe LiveCycle ES 2.5 image.
    Looks like server works and listen 8080.
    In Livecycle Designer I can generate XML (XDP) from PDF, so I can change this XML in PHP/Python/Go script to fill template with data.
    I'm looking for some REST method, where I can give that XML (XDP) and recieve generated PDF in response.
    I've spent whole to for googling all these things, found a lot of docs, but all is very complicated there. Also, examples from just doesn't work - maybe I have to do something on server before calling REST API method.
    Please, push me into right direction

    Your best bet is to probably create an orchestration (or "process" in Adobe speak) that accepts two document parameters, calls LiveCycle Forms (or Output depending on whether you want to interactive or non-interactive PDF), and returns the resulting document variable.
    The orchestration will return a redirect that will point you to the document object.
    See Invoking LiveCycle using REST Requests, and Creating Your First LiveCycle ES4 Application.
    Rob

  • How do I set up/install my complimentary "PDF Portfolio Templates" zip file?

    How do I set up/install my complimentary "PDF Portfolio Templates" zip file?
    The Download site says:  "Please click the button below and select “save” when prompted to download the files to your computer.* To add your content, simply open Acrobat XI and follow the instructions."
    The instructions say:
    "To install a custom layout, select File > Create > PDF Portfolio.
    In the “Create PDF Portfolio” dialog box, click Import Custom
    Layout. Navigate to the custom layout   le on your computer
    and select Open. Layout   les have a .nav extension.   e
    layout appears in the Portfolio Layouts list, where you can select it.
    Imported layouts are permanently added to the Custom
    Layouts section of the Portfolio Layouts panel."
    However, there is no "File>Create>PDF Portfolio" menu option...

    Acrobat Standard can't make Portfolios; you shouldn't have been offered that item when you registered. I suggest you contact Customer Support and ask for your selection to be reset.

  • How to generate PDF using FDF file and the PDF form template (PHP)

    Hi Folks,
    I'm really sorry that I couldn't follow all the valuable discussions going on here, regularly. I need some immediate help.
    I NEED A PHP SOLUTION. I'm able to generate FDF files using the PDF Form Template in PHP. So, I have a collection of FDF files, which seeks the PDF template, while opened and populates the template with FDF data. Now if I need to save this PDF file, I have to do it manually clicking SAVE option. But, I need to convert FDF to PDF in bulk. So, I need some PHP based solution. The PHP script takes the PDF template and the FDF file and merges them to generate a complete populated PDF file. I know it's possible, but don't know how. I've seen Adobe FDF Toolkit. But by default it doesn't show any guideline for PHP. Please help me to write this code. I'm a professional coder. I can understand your hints and tutorials. PLEASE HELP GOOD PEOPLE.

    The only reason I am responding to this post is because the poster sent me a request through the forum message system asking for my help.
    Although I did populate PDFs with FDF data generated by web forms a year or so ago, I have since abandoned that kind of solution. It was a big headache. I found it far more stable and flexible to use html, php and css to populate forms that are almost as nice looking as PDFs.
    So my advice is, if you can possibly avoid going the FDF/PDF route, you will be better off.

  • Fillable PDF form template?

    Hello,
    I was wondering if someone could help me out on a little problem I am having with Adobe Pro, LiveCycle Designer.  I am trying to create fillable PDF office forms.  I have succeeded as far as getting the forms fillable... However, I was wondering if it is possible to turn that fillable PDFs into templates? Meaning, it would automatically ask the user to "save as" rather than saving to the original document.  If there is not a way to turn the document into a "template," then, how can I disable the saving feature on the form.  These forms are filled out by office employees but then given to the client which is why I am so concerned about the saving feature.
    Here the the problem we are running into:  If one of our employee uses the a pdf form, they automatically save the information.  I guess its out of habit.  Then, another employee will use the same form and (sometimes) end up missing information that needed to be deleted from the prior use.  Sometimes, the client will get the completed form with the wrong information.  It always end with
    confusion and other issues.  I have tried asking office employees to stop saving the information after using the form but that doesnt seem to be working out very well.
    I have also tried adding "permissions" to the form which covers the printing & editing rights BUT it also allows the user to save the document which is the exact opposite to what I want...
    I am a bit lost.. I tried googling as well but I havent found another person with the same question. Maybe, I am just goggling the wrong question. OR, maybe, I am setting up the permissions incorrectly. Who knows!
    So this image I uploaded is a fillable PDF receipt that we use to email or mail out to the client with a copy of their receipt.  For this, I would like the person to be able to fill it in but not able to save it OR have adobe ask them to save as instead of just saving the information to the original file.   
    Any help will be much appreciated!!!!!!!!!!!
    Thank you!

    Hi GJen900,
    Please ask Acrobat desktop applicaiton forum(http://forums.adobe.com/community/acrobat/forms) as this forum is for CreatePDF online service.
    Thank you for using Adobe products.
    Hisami

  • How to delete (remove) a approval procedures templates ?

    I have added an approval procedures template for 2 stages for Good Receipt PO.
    then we used this approval procedure for several days.
    recently , our manager hopes me to remove this approval procedure.    ╮(﹀_﹀")╭
    I have tried many methods to delete (remove) or stop this approval procedure.
    but , I still can not find out the solution.
    hope somebody can kindly give me a suggestion. :P

    Hi!
    THERE IS NO WAY TO DO IT.
    If you still want to delete it from the database please create message to SAP support. May be it helps.
    Regards,
    Anton.

  • How do I install the complimentary PDF Portfolio Templates for Acrobat XI

    I download the complimentary PDF Portfolio Templates.  How do I install them to Acrobat XI?

    It depends on the OS you are working. Navigator files (Portfolio templates) usually go in the following locations:
    Windows
    C:\Program Files\Adobe\Acrobat 11.0\Acrobat\Navigators
    Mac
    /Applications/Adobe Acrobat XI Pro/Adobe Acrobat Pro/Contents/Resources/Navs/

  • Installing the complimentary PDF portfolio templates?

    I could download the complimentary PDF portfolio templates, but failed to unzip the file. Adobe Acrobat XI cannot see the zipfile, nor the templates inside. Apparently I am skipping steps?

    I used Winzip, and the details of the error message are:
    Extracting to "C:\Program Files\Adobe\"
    Use Path: yes   Overlay Files: no
    Unable to process "Adobe_Acrobat_XI_PDF_Portfolios\_Instructions\".
    Severe Error:  Not permitted or able to create an output directory.
    2013/3/4 Pat Willener <[email protected]>
         Adobe Community <http://forums.adobe.com/index.jspa>   Re:
    Installing the complimentary PDF portfolio templates?  created by Pat
    Willener <http://forums.adobe.com/people/pwillener> in *Downloading,
    Installing, Setting Up* - View the full discussion<http://forums.adobe.com/message/5119014#5119014

  • In Scom,How to add CAC value in given MP (management pack)? Please give me in detail procedure with example if possible.

    In Scom,How to add CAC value in given MP (management pack)? Please give me in detail procedure with example if possible.

    Hi 
    CAC is System.ConsolidatorCondition condition detection module used to consolidate the monitoring i.e. you can generate an alert on multiple occurrence of issues instituted of generating single alert for issue.
    refer below link for more information
    http://msdn.microsoft.com/en-us/library/ee809324.aspx
    http://social.technet.microsoft.com/wiki/contents/articles/20301.how-to-add-consolidation-for-url-monitoring-in-scom-20072012.aspx
    Regards
    sridhar v

  • How to delete Approval procedure Template,

    I have created one Approval procedure templete in which unfortunately i have taken manager as origenator.
    I have to delete this Procedure template.
    It is urgent.
    Thanks.

    i dont know if this is the right way...
    but there is 2 way i know of,
    1. use query analyser and change the originator from manager to someone else
    something like this
    update wtm1 set userid = '2' where wtmcode = '[code]' and userid = '1'
    2. give another user the autorization to modify the approva procedure which is not in the originator

  • Hi All, Can I access Adobe reader internal variables in my pdf? for example location, file size, creator etc.

    Hi All, Can I access Adobe reader internal variables in my pdf? for example location, file size, creator etc. I want to create a hyperlink in my pdf $Location/another.pdf?

    Thanks Gilad.
    let me rephrase my requirement. I have a group of pdf files where one pdf has hyperlinks to the other pdfs
    parent.pdf
    -- child1.pdf
    -- child2.pdf
    when I click on the child hyperlink I want the child.pdf to be displayed in another window/reader
    If I have the hyperlink as file:./child1.pdf it does not work. It needs a complete path.
    So when I create this file in MSWord first, Can I artificially create a placeholder for the directory and append the child.pdf?
    suppose the properties say Location = /tmp/pdfs/
    can I have in the hyperlink something like file:/$Location/child.pdf and when reader is used it substitutes the url
    so I get file:/tmp/pdfs/child.pdf
    Hope I explained this.
    thanks
    -Francis
    OK, let me have a very simple requirement. Can I create a pdf and when I open it
    there is one line that says - This File is in xxx directory.
    where xxx is the directory name where the file is. If I have the file in /tmp then it should say This file is in /tmp directory
    and if I copy it to /other then open it, it should say This file is in /other directory.

  • How to create PDF Merging Template with Buttons & javascript?

    I am trying to create a PDF template that has buttons that request a file or email be inserted as you progress through the document.
    There will be a drop down menu that has options for different types of "customers", each type of customer will show a different set of buttons.
    Each button, once clicked will prompt for a PDF document to be inserted. Each button will be labeled what it requests. For example, "Receipt", "Title", "Insurance Policy" etc. The documents will need to be merged in the order they were received via the buttons.
    In the end, after all the buttons have requested the specific file, it will merge the selected files into one PDF document.
    Does anyone have some insight or ideas on how to get started on this? I am sure Java script will be involved.
    Thank you! Your help is appreciated!

    Hi Travis ,
    You are absolutely correct ,to get more accuracy ,you will certainly have to use java script to get this task done.
    However if you want to add buttons ,you can do it from Acrobat.
    Tools>Interactive Objects>Add Button
    Please check the button properties if it reduces your work to any extent .Go through all the options and see how it goes.
    Regards
    Sukrit Dhingra

Maybe you are looking for