Creating PDF with XML and APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT

I am trying to generate a PDF report with an existing BLOB stored in a table being applied to a report template. Here is my procedure.
declare
doc blob;
begin
select img into doc from table where id = :P1_SEL_ID;
APEX_UTIL.DOWNLOAD_PRINT_DOCUMENT (
p_file_name => 'Document',
p_content_disposition => 'attachment',
p_report_data => doc,
p_report_layout => 'TEMPLATE1',
p_report_layout_type => 'rtf',
p_document_format => 'pdf'
end;
When I run the procedure adobe acrobat opens but gives me an error message saying "The file cannot be opened because it has no pages".
I am storing the blob through APEX_UTIL.GET_PRINT_DOCUMENT and a report query with the document format 'XML' here.
declare
idoc blob;
begin
doc := APEX_UTIL.GET_PRINT_DOCUMENT (
p_application_id => 103,
p_report_query_name => 'SAVE_XML',
p_document_format => 'xml');
update table set
img = doc
where id = :P1_SEL_ID;
end;
I am pretty sure that the stored files have data in them as I tried downloading and opening them after stored. Any ideas as to why this is? Is it the way I am storing/calling the blob file?
Edited by: BLum on Feb 1, 2010 4:13 PM

Nope sorry. I have no idea really of what could be the problem. I cannot even find a valid example of how to use that process in that way. I posted here as a last resort. As sort of a patch I just read the xml file and inserted the data into a temp table then called a report query on the temp table.

Similar Messages

  • Generating PDF with XML and XSL

    Hi, quick basic question...
    I'm trying to generate pdf doc from xml with xsl.
    I'm using following sample code from xml.apache.org
    response.setContentType("application/pdf");
    Driver driver =new Driver();
    driver.setOutputStream(response.getOutputStream());
    driver.setRenderer(Driver.RENDER_PDF);
    Transformer transformer=TransformerFactory.newInstance()
    .newTransformer(new StreamSource("foo.xsl"));
    transformer.transform(xmlsource, new SAXResult(driver.getContentHandler()));
    xmlSource is my regular xml that wants to be pdf.
    is foo.xsl any regular xsl that I use to coonvert xml into html?
    or is it some special xsl that is tailored for pdf.
    Is this what is called xsl-fo?
    Thanks
    IL

    Hi IL,
    XSLT can translate XML to something else. It is most suited to transforming to another tree-like format (XML, HTML, etc.) but can be 'asked' to produce other kinds of output, flat text for example.
    It is driven by an XSL file which is a series of patterns to match and output to produce.
    This XSL file can be used to generate another XML document in which the nodes come from the Formatting Object namespace. These describe, in generic terms the format of an output document based upon the contents of the original XML.
    The formatting object XML document can then be used as input to a formatting object XML processor which can generate PDF output from it.
    You may want to check out:
    www.w3c.org
    for all the stuff on XML, XSL, XSLT, Formatting Objects, etc., and:
    xml.apache.org
    for imformation on Xalan, which is an XSL processor and FOP, which is a formatting object processor.
    Hope that helps,
    Peter.

  • Illustrator cs2 creates pdf with anomalies

    I have Illustrator cs2 (12.0.1) and I create pdfs with it and send these to my clients for proofing. When I view the pdf in acrobat standard 6 it looks fine. When my sales people and clients view it in reader 8 they get a color break down that is incorrect. For example they see a color that should not be there (in the pdf below it is the blue cyan in the logo). So I need to figure out how to fix this problem. Also it does not happen on every pdf.
    here is a link to a pdf
    www.ebfchurch.org/usb3.pdf
    In the link is a pdf that has a problem, and a jpeg to show what it should look like.
    When I save the pdf I have tried turning illustrator off ill. editing capabilities and saved as a V.7 pdf. Not sure what else to try besides making the logo a jpg. Would upgrading to reader 8 help? Would this add that to my selections in illustrator?
    The other anomalies are I's and some lines becoming a dotted line. This one is rarer and is easy to fix (somewhat). I simply rotate the object by a super small portion that no one would notice.
    Thanks for any help.

    Most likely some color separation or transparency flattening thing. Could also be the order of your groups/ shapes. Just hard to tell. For testing, I would save a PDF and do a preflight check in Acrobat or other such tool. This usually reveals any problematic stuff...
    Mylenium

  • What are the best options for creating a PDF with bookmarks and a hyperlinked TOC?

    What I'm interested in is whether or not there is an alternate process I could follow that would side step Word 2011's inability to export to PDF with bookmarks and hyperlinked TOCs. How do you create PDF documents with bookmarks and hyperlinked TOCs in your documents?
    Some background:
    In Word 2010 and 2013 for Windows (and I'm sure this applies to older versions as well), you can export documents to a PDF file format where the exported file will carry over the bookmarks and hyperlinked table of contents. Specifically, by making specific text headers, will appear in the final PDF file as bookmarks on the side (see image taken from Adobe's website).
    Regarding the table of contents, using Word's built in Table of Contents feature successfully ports the ability to navigate to a specific section by clicking on its chapter in the table of contents to the finished PDF file.
    I've read several forum discussions that say it's not possible to do this from Word 2011, so my current solution is to just finish all documents on a Windows machine (either with parallels or a separate computer). The alternate process flow of creating a word document, exporting it to PDF, then rehyperlinking everything in Acrobat is just too time consuming to consider.

    Hi, beejasaurus
    I found a possible kluge from this discussion here
    https://forums.adobe.com/thread/1008480
    Create the hyperlinks in Word, save the file
    Open that file with Pages, export as PDF.
    The links work from that PDF.
    Note, I did not try this with TOC but it worked with hyperlinks embedded in the Word document

  • How to create PDF with Form Builder (T-Code:SPF) and how to use it?

    How to create PDF with Form Builder (T-Code:SPF) and how to use it? Is there anyone can show me some doc. or PA material ? << removed >>  Thank you very much!!
    Edited by: Rob Burbank on Nov 11, 2010 1:04 PM

    PDF forms also known as Adobe From or Interactive Forms.
    Check this link -
    Interactive Forms
    REG:ADOBE FORM
    Adobe forms
    Regards,
    Amit

  • PO output with XML and PDF format

    Hi All,
    I need PO output with XML and PDF format. when I give print it shld go to vendor with xml and pdf format through mail. please kindly guide me on this .
    Thanks in advance
    JK

    hi,
    try this code to get in pdf form
    REPORT zsuresh_test.
    Variable declarations
    DATA:
    w_form_name TYPE tdsfname VALUE 'ZSURESH_TEST',
    w_fmodule TYPE rs38l_fnam,
    w_cparam TYPE ssfctrlop,
    w_outoptions TYPE ssfcompop,
    W_bin_filesize TYPE i, " Binary File Size
    w_FILE_NAME type string,
    w_File_path type string,
    w_FULL_PATH type string.
    Internal tables declaration
    Internal table to hold the OTF data
    DATA:
    t_otf TYPE itcoo OCCURS 0 WITH HEADER LINE,
    Internal table to hold OTF data recd from the SMARTFORM
    t_otf_from_fm TYPE ssfcrescl,
    Internal table to hold the data from the FM CONVERT_OTF
    T_pdf_tab LIKE tline OCCURS 0 WITH HEADER LINE.
    This function module call is used to retrieve the name of the Function
    module generated when the SMARTFORM is activated
    CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
    EXPORTING
    formname = w_form_name
    VARIANT = ' '
    DIRECT_CALL = ' '
    IMPORTING
    fm_name = w_fmodule
    EXCEPTIONS
    no_form = 1
    no_function_module = 2
    OTHERS = 3
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    Calling the SMARTFORM using the function module retrieved above
    GET_OTF parameter in the CONTROL_PARAMETERS is set to get the OTF
    format of the output
    w_cparam-no_dialog = 'X'.
    w_cparam-preview = space. " Suppressing the dialog box
                                                        " for print preview
    w_cparam-getotf = 'X'.
    Printer name to be used is provided in the export parameter
    OUTPUT_OPTIONS
    w_outoptions-tddest = 'LP01'.
    CALL FUNCTION w_fmodule
    EXPORTING
    ARCHIVE_INDEX =
    ARCHIVE_INDEX_TAB =
    ARCHIVE_PARAMETERS =
    control_parameters = w_cparam
    MAIL_APPL_OBJ =
    MAIL_RECIPIENT =
    MAIL_SENDER =
    output_options = w_outoptions
    USER_SETTINGS = 'X'
    IMPORTING
    DOCUMENT_OUTPUT_INFO =
    job_output_info = t_otf_from_fm
    JOB_OUTPUT_OPTIONS =
    EXCEPTIONS
    formatting_error = 1
    internal_error = 2
    send_error = 3
    user_canceled = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
    WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
    ENDIF.
    t_otf[] = t_otf_from_fm-otfdata[].
    Function Module CONVERT_OTF is used to convert the OTF format to PDF
    CALL FUNCTION 'CONVERT_OTF'
    EXPORTING
    FORMAT = 'PDF'
    MAX_LINEWIDTH = 132
    ARCHIVE_INDEX = ' '
    COPYNUMBER = 0
    ASCII_BIDI_VIS2LOG = ' '
    PDF_DELETE_OTFTAB = ' '
    IMPORTING
    BIN_FILESIZE = W_bin_filesize
    BIN_FILE =
    TABLES
    otf = T_OTF
    lines = T_pdf_tab
    EXCEPTIONS
    ERR_MAX_LINEWIDTH = 1
    ERR_FORMAT = 2
    ERR_CONV_NOT_POSSIBLE = 3
    ERR_BAD_OTF = 4
    OTHERS = 5
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    To display File SAVE dialog window
    CALL METHOD cl_gui_frontend_services=>file_save_dialog
    EXPORTING
    WINDOW_TITLE =
    DEFAULT_EXTENSION =
    DEFAULT_FILE_NAME =
    FILE_FILTER =
    INITIAL_DIRECTORY =
    WITH_ENCODING =
    PROMPT_ON_OVERWRITE = 'X'
    CHANGING
    filename = w_FILE_NAME
    path = w_FILE_PATH
    fullpath = w_FULL_PATH
    USER_ACTION =
    FILE_ENCODING =
    EXCEPTIONS
    CNTL_ERROR = 1
    ERROR_NO_GUI = 2
    NOT_SUPPORTED_BY_GUI = 3
    others = 4
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    Use the FM GUI_DOWNLOAD to download the generated PDF file onto the
    presentation server
    CALL FUNCTION 'GUI_DOWNLOAD'
    EXPORTING
    BIN_FILESIZE = W_bin_filesize
    filename = w_FULL_PATH
    FILETYPE = 'BIN'
    APPEND = ' '
    WRITE_FIELD_SEPARATOR = ' '
    HEADER = '00'
    TRUNC_TRAILING_BLANKS = ' '
    WRITE_LF = 'X'
    COL_SELECT = ' '
    COL_SELECT_MASK = ' '
    DAT_MODE = ' '
    CONFIRM_OVERWRITE = ' '
    NO_AUTH_CHECK = ' '
    CODEPAGE = ' '
    IGNORE_CERR = ABAP_TRUE
    REPLACEMENT = '#'
    WRITE_BOM = ' '
    TRUNC_TRAILING_BLANKS_EOL = 'X'
    WK1_N_FORMAT = ' '
    WK1_N_SIZE = ' '
    WK1_T_FORMAT = ' '
    WK1_T_SIZE = ' '
    IMPORTING
    FILELENGTH =
    tables
    data_tab = T_pdf_tab
    FIELDNAMES =
    EXCEPTIONS
    FILE_WRITE_ERROR = 1
    NO_BATCH = 2
    GUI_REFUSE_FILETRANSFER = 3
    INVALID_TYPE = 4
    NO_AUTHORITY = 5
    UNKNOWN_ERROR = 6
    HEADER_NOT_ALLOWED = 7
    SEPARATOR_NOT_ALLOWED = 8
    FILESIZE_NOT_ALLOWED = 9
    HEADER_TOO_LONG = 10
    DP_ERROR_CREATE = 11
    DP_ERROR_SEND = 12
    DP_ERROR_WRITE = 13
    UNKNOWN_DP_ERROR = 14
    ACCESS_DENIED = 15
    DP_OUT_OF_MEMORY = 16
    DISK_FULL = 17
    DP_TIMEOUT = 18
    FILE_NOT_FOUND = 19
    DATAPROVIDER_EXCEPTION = 20
    CONTROL_FLUSH_ERROR = 21
    OTHERS = 22
    IF sy-subrc <> 0.
    MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
    ENDIF.
    reward points if useful,
    siri

  • Why i can't create PDF with right format by LiveCycle?

    Hello,
    As we know that PDF format has four sections, the header, object body, cross-reference table and trailer.
    But after I create a PDF by Adobe LiveCycle, and open it by UltraEdit or Notepad, I cannot find the cross-reference table and some objects, “trailer” word either .
    I try to download several PDF files by follow link:
    https://my.adobeconnect.com/_a295153/p10077996/?launcher=false&fcsContent=true&pbMode=norm al ,
    and open them as the same way as before, it was the normal format I learn.
    So, why my PDF is not the right format? And how can I create PDF with right format?
    Thank you a lot!
    Ellie

    Adobe LiveCycle Designer makes XFA forms - a thin PDF wrapper around XML, no useful PDF page objects. Still, they are valid PDF. Like any PDF, you might not find a trailer or xref if a cross reference stream is used. See ISO 3200-1 7.5.8 "Cross-Reference Streams".

  • Creating PDF from XML directly in a content management system?

    Hi!
    This is my first post here and I've tried to find any previous posts that could answer my question but to no avail. Also I think and hope this is the correct sub forum to post it in.
    I work at a company that produces a product catalogue that is published as a webpage, a PDF document (used as the basis for a tablet app) and a printed catalogue from a PDF. For the PDF (used in the tablet app and the printed catalogue) we are using a CMS based on XML that produces Adobe FrameMaker documents which we then export the PDF from. We are looking in to updating the system and make it flow much better but are a bit uncertain of what the best way to go would be.
    A solution I'm thinking of would be to have the content of the product catalogue in some kind of XML based service that can export the information in XML. This would hopefully make it possible to send the documents either directly to PDF by XML and some style sheets or import the XML into some InDesign templates (for the more complicated designs at intro pages etc).
    One important aspect of the product catalogue is that we have all information saved in different languages so there has to be some kind of connection between the templates and different language versions -- ie. the page design but different language text flows for each language edition.
    What I wonder is. What kind of services/solutions would there be that handles XML to PDF for a quite complicated product catalogue (ie. the different language versions)?
    Thanks in advance!

    The difference between the two packages is that PatternStream effectively works on a "pull" principle (the content is retrieved into the template(s) by queries at the appropriate locations), while Miramo is a "push" (the tagged content is processed by Miramo using templates to create the DTP files). SInce Miramo allows programatical processing before the content is pushed into the DTP app, you can do all sorts of manipulations, conditional processing, automatically insert markers and variables, etc. so it allows for a fairly complex layout, even with FrameMaker. It also allows api's and scripts to be triggered at the backend when the publication has been assembled for further processing/manipulation.
    Is there any particular reason that you want to move from the FM engine to the ID one? In terms of throughpu,t FM streams run very much faster than ID ones. Also, unless the layouts are extremely complex, in an automated environment, there are very few catalogue layouts that I've seen that couldn't also be handled using a FM workflow.
    Are there any samples on line of the types of catalogues that you are currently producing? This would help in assessing which tools and workflows might be more appropriate to your situation.

  • My Adobe Acrobat 10 Pro creates PDFs with a graph background.  How do I make the background white?

    My Adobe Acrobat 10 Pro creates PDFs with a GRAPH background.  How do I make the scanned documents have a normal white background?

    This particular forum (sharing and storage) was created to help those transitioning from Photoshop.com to Adobe Revel. I will move your post to the correct forum so that it can get proper attention.
    We also have many other forums relating to other Adobe products at: http://forums.adobe.com.
    Out of curiosity, can you tell me how you found our forum page?

  • Problem in creating PDF with InDesign CS5.5

    Problem in creating PDF with InDesign CS5.5:
    exporting a file in pdf, setting "Press Quality" or "PDF/X-1a: 2001" and selecting "Crop Marks" and the surplus of xx mm, the elements contained in the MASTER page move from the original position or disappear at random.
    Can you help me, please?
    Thanks a lot.

    Try Remove minor corruption by exporting

  • Pdf (with graphics and text) in the email body

    When I place an pdf (with graphics and text) in the body of my email using Mac Mail my recipient sees them as attachments only. I am trying to find a way of presenting a formatted email with graphics that will appear the same way to all recipients, but a pdf frequently ends up being an attachment instead of staying in the body. The pdf  file doesn’t seem to always show up in the body as created. Is there a better way to accomplish this?

    You have no control over how your email maybe rendered by other email servers and client side software.
    Attachment Tamer may give you a few more options but it does not guaranty the end result.

  • Guidance with XML and templates

    I am currently saving metadata in separate xml files, each of which pertains to a particular image.
    (They all resemble the sample XML file above, but with different data, and possibly empty values
    in some fields). Currently, no fields are required (but may be in the future).
    I am now trying to define a template for the xml files...However, I am a novice with XML and am
    having trouble creating a template and its constraints.
    I would like the template to:
    - Impose an order on the metadata fields, so when I read it in, I can get the appropriate field
    at the appropriate time.
    - Validate that the type of data entered into those fields are correct.
    - If no xml file exists for that image, I will be able to pull in the field names (in order)
    into my program, and create a GUI with the field names and no data
    - If an xml file does exists for that image, I will be able to pull in the field names (in order)
    into my program, and create a GUI with the field names and the data in the xml file
    I'm assuming that this template would have to be read in each time a user requests to see the
    information associated with an image.
    SAMPLE XML FILE
    <?xml version="1.0" encoding="UTF-8"?>
    <Image>
    <metadata>
      <Miscellaneous>Here is more Jibberish to fill space</Miscellaneous>
      <Photographer>Mayor McCheese</Photographer>
      <Date>Sat, Sep 22, 1922</Date>
      <Project>44an5</Project>
      <Supervisor>Colonel Sanders</Supervisor>
      <Location>The Moon</Location>
    </metadata>
    </Image>/*
    I'm assuming the template would take on a form similar to below...
    "order" would be the order that they would be placed into the GUI.
    "type" would be the type of data allowed in that field (string, int, long, date, etc...)
    in this case 'long' is Oracles definition of long and not Javas.
    SAMPLE TEMPLATE
    <Image>
    <metadata>
      <Project order=0 type=String></Project>
      <Date order=1 type=Date></Date>
      <Photographer order=2 type=String></Photographer>
      <Supervisor order=3 type=String></Supervisor>
      <Miscellaneous order=4 type=Long></Miscellaneous>
      <Location order=5 type=String></Location>
    </metadata>
    </Image>Can anyone guide me in the right direction or offer some hints?
    Thanks,
    Dustpan

    bump?

  • Create View  with Force and No Force

    Can Anyone Tell me how to create view with force and no force i have very little idea about this

    This is the syntax.
    CREATE [OR REPLACE] FORCE VIEW view
    [(alias[, alias]...)]
    AS subquery
    [WITH CHECK OPTION [CONSTRAINT constraint]]
    [WITH READ ONLY [CONSTRAINT constraint]];You can see interesting threads about this topic here.
    Re: Creating view forcibly
    Creating View forcefully
    Cheers
    Sarma.

  • Create Window with Textbox and Button For getting Input Value

    Hi All,
    I have create plugin application but i want to take input from user. Therefore i want to create window with textbox and button.
    please may i get solution...

    Or if that's all you need to do, just use JavaScript or a form.

  • Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance-..

    Can anyone recommend an alternative software programme to Pages? I have an OS X 10.7.5 macbook pro, so I am unable to get it. I want a programme that I can create docs with pictures and text on, invitations, posters etc. Many thanks in advance…..

    LibreOffice

Maybe you are looking for

  • Open Link in New Window creates an invisible window (visible after restarting).

    When I use the right mouse button menu to Open Link in New Window from a web page it creates an invisible window. That is, I cannot see the window but it is listed in the Firefox Window menu. This newly opened window cannot be selected either by mous

  • Bluetoothdemo "can't load images"

    Hi, i am currently trying this bluetoothdemo on SE k750 and SE c903 and everything seem to be ok except when i try to load the published image. i get "Can't load images". Any advices would be grateful. thanks.

  • Emails headers received as part of email text

    We are using the script below to send email notifications. When a user receives the mail part of the email headers are included in the message body. I have included an example underneath the script. procedure pm33_verification_mail  ( email_in  in va

  • How I can't unlock my apple acount because i forgot the answers of the security questions?

    How I can't unlock my apple acount because i forgot the answers of the security questions?

  • Discount amount

    Hi all, To our customers we sometimes wants to give a discount in the form of an amount instead of a %. We can use the field down at the right after Total before discount but that's not what we want to use, because.. We use the XL reporter to create