PDF file created from Oracle Report is created wrongly using dbms_lob

Hi,
Please help. It is very urgent.
I am using Oracle Developer 10gR2, Oracle Report 10.1.2 on Windows 2000.
I would like to attach the PDF file created by Oracle Report to the Notification sent from Workflow.
I use the following package procedure in my Workflow.
procedure Create_File_Attachment (document_id   in varchar2, display_type  in varchar2,
                                                                                     document      in out blob, document_type in out varchar2)
is
     l_itemtype          varchar2(100);
     l_itemkey           varchar2(100);
     l_output_directory  varchar2(30);
     l_filename          varchar2(255);
     src_loc             bfile;
     bdoc                blob;
     src_offset          number := 1;
     dst_offset          number := 1;
     amount              number;
begin
     l_itemtype := substr(document_id, 1, instr(document_id, ':') - 1);
     l_itemkey := substr(document_id, instr(document_id, ':') + 1, length(document_id) - 2);
     l_output_directory := 'USR_TMP_DIR';
     l_filename := Wf_Engine.GetItemAttrText(l_itemtype, l_itemkey, 'ATR_FILENAME');
     src_loc := bfilename(l_output_directory,l_filename);
     dbms_lob.createTemporary(bdoc, FALSE, dbms_lob.call);
     dbms_lob.fileopen(src_loc, dbms_lob.file_readonly);
     dbms_lob.loadblobfromfile(bdoc,src_loc,dbms_lob.lobmaxsize,src_offset,dst_offset);
     dbms_lob.fileclose(src_loc);
     amount := dbms_lob.getLength(bdoc);
     dbms_lob.copy(document,bdoc,amount,1,1);
     document_type := 'application/pdf; name=attach.pdf';
end Create_File_Attachment;Oracle Report created the PDF file correctly (original.pdf).
I tried to attach the PDF into my Workflow.
I can see the file is attached (attach.pdf), but it cannot be opened.
The Adobe shows : 'A drawing error occured.' each time I open the attachment.
I compare the original.pdf and the attach.pdf
However, there is one specific difference
- in original.pdf, the line started with '.' (single period)
in attach.pdf, the line is started with '..' (two periods)
Thus the attachment cannot be opened.
After I delete the period, it can be opened.
Question:
- Has someone ever succeed in attaching the PDF created from Report?
- Are the codes above is wrong?
- Or perhaps the DBMS_LOB.LOADBLOBFROMFILE always double the single period on front of the line?
- Is there any solution on this?
Note:
I have succeed in attaching PDF files unless the PDF created by the Report.
Sorry for the long post.
Please help. It is very urgent.
Any help is appreciated.
Many thanks,
Buntoro

Hi,
Please help. It is very urgent.
I am using Oracle Developer 10gR2, Oracle Report 10.1.2 on Windows 2000.
I would like to attach the PDF file created by Oracle Report to the Notification sent from Workflow.
I use the following package procedure in my Workflow.
procedure Create_File_Attachment (document_id   in varchar2, display_type  in varchar2,
                                                                                     document      in out blob, document_type in out varchar2)
is
     l_itemtype          varchar2(100);
     l_itemkey           varchar2(100);
     l_output_directory  varchar2(30);
     l_filename          varchar2(255);
     src_loc             bfile;
     bdoc                blob;
     src_offset          number := 1;
     dst_offset          number := 1;
     amount              number;
begin
     l_itemtype := substr(document_id, 1, instr(document_id, ':') - 1);
     l_itemkey := substr(document_id, instr(document_id, ':') + 1, length(document_id) - 2);
     l_output_directory := 'USR_TMP_DIR';
     l_filename := Wf_Engine.GetItemAttrText(l_itemtype, l_itemkey, 'ATR_FILENAME');
     src_loc := bfilename(l_output_directory,l_filename);
     dbms_lob.createTemporary(bdoc, FALSE, dbms_lob.call);
     dbms_lob.fileopen(src_loc, dbms_lob.file_readonly);
     dbms_lob.loadblobfromfile(bdoc,src_loc,dbms_lob.lobmaxsize,src_offset,dst_offset);
     dbms_lob.fileclose(src_loc);
     amount := dbms_lob.getLength(bdoc);
     dbms_lob.copy(document,bdoc,amount,1,1);
     document_type := 'application/pdf; name=attach.pdf';
end Create_File_Attachment;Oracle Report created the PDF file correctly (original.pdf).
I tried to attach the PDF into my Workflow.
I can see the file is attached (attach.pdf), but it cannot be opened.
The Adobe shows : 'A drawing error occured.' each time I open the attachment.
I compare the original.pdf and the attach.pdf
However, there is one specific difference
- in original.pdf, the line started with '.' (single period)
in attach.pdf, the line is started with '..' (two periods)
Thus the attachment cannot be opened.
After I delete the period, it can be opened.
Question:
- Has someone ever succeed in attaching the PDF created from Report?
- Are the codes above is wrong?
- Or perhaps the DBMS_LOB.LOADBLOBFROMFILE always double the single period on front of the line?
- Is there any solution on this?
Note:
I have succeed in attaching PDF files unless the PDF created by the Report.
Sorry for the long post.
Please help. It is very urgent.
Any help is appreciated.
Many thanks,
Buntoro

Similar Messages

  • I am unable to read signatures on PDF files sent from my Los Angeles office - they use windows, any solution?

    I am unable to read signatures on PDF files sent from my Los Angeles office - they use windows, any solution?

    Hey guys,
    So this is follow up from my debarkle with the EDD. I found out my problem with copying files from Mac to EDD and vice versa was a result of a not so good EDD ( i had an apollo hard drive from imation) that was not very compatible with macs. So i did my research and found out that the best hard drives were Western Digital and Seagate. I bought the newest western digital EDD 1TB and formated it to FAT32 and guess what...no problems so far. The only problem is that FAT32 format doesn't copy files larger than about 4 gigs so i couldnt copy a movie from my brothers computer onto my EDD that was 1080p. You could probably resolve that by partitioning a small part of your hard drive in ExFAT? but yeah, hopefully that helped guys.
    Aaisha

  • PDF file created from Oracle Report is attached wrongly

    Hi,
    Please help. It is very urgent.
    I am using Oracle Developer 10gR2, Oracle Report 10.1.2 on Windows 2000.
    I would like to attach the PDF file created by Oracle Report to the Notification sent from Workflow.
    I use the following package procedure in my Workflow.
    procedure Create_File_Attachment (document_id   in varchar2, display_type  in varchar2, document      in out blob, document_type in out varchar2)
    is
         l_itemtype          varchar2(100);
         l_itemkey           varchar2(100);
         l_output_directory  varchar2(30);
         l_filename          varchar2(255);
         src_loc             bfile;
         bdoc                blob;
         src_offset          number := 1;
         dst_offset          number := 1;
         amount              number;
    begin
         l_itemtype := substr(document_id, 1, instr(document_id, ':') - 1);
         l_itemkey := substr(document_id, instr(document_id, ':') + 1, length(document_id) - 2);
         l_output_directory := 'USR_TMP_DIR';
         l_filename := Wf_Engine.GetItemAttrText(l_itemtype, l_itemkey, 'ATR_FILENAME');
         src_loc := bfilename(l_output_directory,l_filename);
         dbms_lob.createTemporary(bdoc, FALSE, dbms_lob.call);
         dbms_lob.fileopen(src_loc, dbms_lob.file_readonly);
         dbms_lob.loadblobfromfile(bdoc,src_loc,dbms_lob.lobmaxsize,src_offset,dst_offset);
         dbms_lob.fileclose(src_loc);
         amount := dbms_lob.getLength(bdoc);
         dbms_lob.copy(document,bdoc,amount,1,1);
         document_type := 'application/pdf; name=attach.pdf';
    end Create_File_Attachment;Oracle Report created the PDF file correctly (original.pdf).
    I tried to attach the PDF into my Workflow.
    I can see the file is attached (attach.pdf), but it cannot be opened.
    The Adobe shows : 'A drawing error occured.' each time I open the attachment.
    I compare the original.pdf and the attach.pdf
    However, there is one specific difference
    - in original.pdf, the line started with '.' (single period)
    in attach.pdf, the line is started with '..' (two periods)
    Thus the attachment cannot be opened.
    After I delete the period, it can be opened.
    Question:
    - Has someone ever succeed in attaching the PDF created from Report?
    - Are the codes above is wrong?
    - Or perhaps the DBMS_LOB.LOADBLOBFROMFILE always double the single period on front of the line?
    - Is there any solution on this?
    Note:
    I have succeed in attaching PDF files unless the PDF created by the Report.
    Sorry for the long post.
    Please help. It is very urgent.
    Any help is appreciated.
    Many thanks,
    Buntoro

    The code looks absolutely good. I have the same code working in my system. Only difference is I use TRUE and DBMS_LOB.Session for the BLOB I use to read from the BFILE.
    I can suggest one more way to handle to binary attachments if you are on Oracle 9i DB are later versions.
    procedure attach_document (p_document_id   in varchar2,
                               p_display_type  in varchar2,
                               p_document      in out nocopy clob,
                               p_document_type in out nocopy varchar2)
    is
      l_nid        number;
      l_directory  varchar2(100);
      l_filename   varchar2(100);
      l_content_type varchar2(100);
      l_src_offset binary_integer := 1;
      l_dst_offset binary_integer := 1;
      l_err_msg    varchar2(100);
      l_amount     number;
      l_bfile BFILE;
      l_blob  BLOB;
      l_clob  CLOB;
      file_not_found exception;
      pragma EXCEPTION_INIT(file_not_found, -22288);
    begin
      l_nid := to_number(p_document_id);
      l_directory := trim(wf_notification.GetAttrText(l_nid, 'ATTR_DIRECTORY'));
      l_filename := trim(wf_notification.GetAttrText(l_nid, 'ATTR_FILENAME'));
      l_content_type := trim(wf_notification.GetAttrText(l_nid, 'ATTR_CONTENT_TYPE'));
      l_bfile := BFILENAME(l_directory, l_filename);
      dbms_lob.createtemporary(l_blob, true, dbms_lob.Session);
      dbms_lob.createtemporary(l_clob, true, dbms_lob.Session);
      begin
        dbms_lob.FileOpen(l_bfile, dbms_lob.File_Readonly);
      exception
        when file_not_found then
          l_err_msg := to_char(sqlcode)||' - Attachment File "'||l_filename||'" is not found.';
          raise_application_error(-20002, l_err_msg);
      end;
      dbms_lob.LoadBLOBFromFile(l_blob, l_bfile, dbms_lob.LobMaxSize, l_src_offset, l_dst_offset);
      dbms_lob.FileClose(l_bfile);
      -- Encode the BLOB content to BASE64 and attach to notification  
      wf_mail_util.EncodeBLOB(l_blob, l_clob);
      l_amount := dbms_lob.GetLength(l_clob);
      dbms_lob.Copy(p_document, l_clob, l_amount, 1, 1);
      -- Mention an appropriate Content Type so that Notification System
      -- understands the attachment content
      p_document_type := l_content_type||'; encoding=base64; name='||l_filename;
    end attach_document;Here I read the BLOB from the filesystem and base64 encode it before giving it to the Mailer. Please note that this is a PLSQLCLOB based attachment as against PLSQLBLOB that you are using.
    Thanks - Vijay

  • Does Pages alleviate the problem of bloated pdf files created when using Word for Mac?

    I am finishing up my PhD dissertation and need to convert it to a .pdf file to be able to send it via email, however, as many are probably aware, when making pdfs directly from Word for Mac the pdf files are enourmous!  If I move the document over to a Windows machine, the pdf is managable, but with all the little formatting details of a thesis, it screws up enough that it will be torture to have to fix it.  I will glady get Pages (I was going to switch after my defense anyway) if I can make a pdf that is not 140 MB (my thesis .docx file is a little over 500MB)!

    In Pages you have the option to export to Pdf and can choose between good, better and best versions. Beware though it is often the images that will lose in resolution. This is what the Pages User Guide says:
    If you’re exporting to PDF, you must choose an image quality (a higher image quality results in a larger PDF file):
    Best: Image resolutions are not scaled down.
    Better:          Images are downsampled to 150 dpi. Images without transparency (alpha
    channel) are JPEG-compressed by 0.7.
    Good:          Images are downsampled to 72 dpi. Images without transparency (alpha channel) are JPEG-compressed by 0.9.

  • Extracting text from PDF files produced by Oracle reports

    Hi,
    I am currently using Report Builder 9.0.4.0.21 to produce reports in PDF format.
    The pdf reports were displayed to screen and printed to printer correctly.
    However, doing a copy-and-paste from the pdf report to a text editor produces
    garbage characters. Also, I failed to extract the text using any of available adobe
    plug-ins. I know that the PDF report is using font subseting with custom
    encoding.I have already read the pdf reference manual and it seems that
    the PDF report is missing the mapping tables to convert the custom encoding
    used in the report back to ansi or unicode.
    Is there a solution to this problem?
    Are there any environment variables or settings that I am missing?
    Your help is really appreciated.

    Hello,
    Your problem may be related to a limitation in the PDF generated with Reports 9.0.2 / 9.0.4 when using Subsetting :
    Font Subsetting Creates PDF Output not Searchable with Acrobat Reader (Doc ID 311345.1)
    This limitation no more exists in Reports 10.1.2 / 11.1
    Regards

  • Need to build Nicely formatted XLS report from Oracle reports

    Hi,
    Please let me know if there is any option in developing a formatted XLS report from Oracle reports.
    I am using Report Builder 10.1.2.0.2.
    Please advice.

    Hi,
    it may help you.
    Generating Oracle reports o/p to xls format.
    PS

  • How to create pdf files in UNIX directory from oracle reports

    I would like to know how to create pdf files in UNIX directory from oracle reports.
    Thanks,

    Please make your question more clear . Also mention the reports version.
    1) If you are runnning reports in Unix, you can give
    .... destype=file desformat=pdf desname=<filename>
    in command line
    Please refer docs below.
    2) If by your question you mean
    "My reports server is running in Windows but I want to ftp my files to Unix after creating it"
    then the answer is that you can use pluggable destination "ftp"
    .... destype=ftp desformat=pdf desname=<ftp url>
    Pluggable destinations download
    http://otn.oracle.com/products/reports/pluginxchange/index.html
    Thanks
    Ratheesh
    [    All Docs     ]
    http://otn.oracle.com/documentation/reports.html
    [     Publishing reports to web  - 10G  ]
    http://download.oracle.com/docs/html/B10314_01/toc.htm (html)
    http://download.oracle.com/docs/pdf/B10314_01.pdf (pdf)
    [   Building reports  - 10G ]
    http://download.oracle.com/docs/pdf/B10602_01.pdf (pdf)
    http://download.oracle.com/docs/html/B10602_01/toc.htm (html)
    [   Forms Reports Integration whitepaper  9i ]
    http://otn.oracle.com/products/forms/pdf/frm9isrw9i.pdf

  • How to send a PDF file as a FAX from Oracle Reports 6i

    Hi
    I want to know how to send a PDF file as a FAX from Oracle Reports 6i. Or please post any sample code in reports that sends PDF document as FAX
    Help need immediately.
    Thanks in advance. my email id is
    [email protected]
    Arun
    null

    hello,
    there is no native support for directly faxing a report. you could e.g. use a fax-software that has a printer-driver that supports this.
    regards,
    the oracle reports team

  • Generated pdf file from oracle reports show bad characters

    Hello all,
    Iam fighting with a problem with generated pdf file from oracle reports which show some bad characters. I was searching for some information but it didnt help...
    I have Oracle Database 11g R2 (or 10g R2) on Oracle Linux or Windows, Oracle forms and reports 6i (i know that is very old and not supported with 11gr2 but we are in this scenario).
    NLS parameters are set like this
    server:
    NLS_CHARACTERSET EE8MSWIN1250
    NLS_TERRITORY AMERICA
    NLS_LANGUAGE AMERICAN
    client:
    NLS_CHARACTERSET EE8MSWIN1250
    NLS_TERRITORY SLOVAK
    NLS_LANGUAGE SLOVAKIA
    When I run Oracle Reports it show perfect in display and when I try to print them, they are all good with good characters, but when I try to generate pdf file, some characters like č,š,ľ are not displaying corectly... This happen only when try to generate to pdf...
    I try to work with uifont.ali on client side but without any result. Fonts for reports were installed on client and server side... Can someone help me with this problem? Thank you very much for every advice.
    Martin

    Hi Sergiusz,
    Thank you for your reply. I look at what you wrote and try to make some test...
    1) For first I download FontForge, which can generate type1 font from true type. So I open FontForge and open my Arial.ttf font and use "Generate Fonts" to save my Arial.ttf font to pfb and pfm (whoch are need to set in uifont.ali). I have to change encoding, because my font has 2byte encoding so I reecondode the font from ISO10646-1 to ISO8859-2 and generate to pfb.
    2) Then I navigate REPORTS_PATH from regedit to my *.pfm and *.pfb files.
    3) I add these lines to end of my uifont.ali
    [ PDF:Embed ]
    Arial = "Arial.pfm Arial.pfb"
    ArialNarrow = "ArialNarrow.pfm ArialNarrow.pfb"
    4) Then I generate my report but nothing change... I check "Font used" in my pdf file, but there were not my fonts embedded I guess..
    I also try PDF:Subset, but it doesnt change anything... I try PDF aliasing to see if my uifont is working - this work very well, but I dont need to change font...
    Any other advice? Thank you so much to everyone!
    Martin

  • I am unable to open PDF files created from another PGM.

    Is there an ADOBE pgm that will properly read in PDF files created from another pgm and convert them to ADOBE PDF so they do not error when they are opened to be viewed by ADOBE pgm?

    There is no way to know all the different scan/fax/pdf printers that are used to make the original PDFs...
    CAD-KAS PDF Editor 2.6 is used to edit the files
    doPDF 5 is used to modify pdf file.
    Interesting, I can use the free CAD-KAS PDF reader to open & read the PDF file that the ADOBE XI reader
    gives me the above error message.

  • PDF files created in Preview won't open in Adobe Reader

    I consider Preview to be a swiss army knife when it comes to working with PDF and graphic files. Lately (since the last OS update?) PDF files created in Preview won't open in Adobe Reader. Reader either crashes or just becomes unresponsive. I've been able to open the files in older versions of Adobe Professional but Reader 8 or 9 can't open the files. Anyone else experiencing these problems?

    Yes. We noticed this problem after upgrading to 10.6.7. When we made a PDF from Word 2011 or even Text Edit through Adobe's "Save as Adobe PDF" it would hang. When we made a PDF using Apple's "Save as PDF" it would lock up Acrobat Pro 9 and also Acrobat Pro X. NOTE that this only happened using Adobe OTF fonts.
    I posted this problem on Adobe's forum and received a message from admin there that this was caused by a change in font handling with Apple's 10.6.7 update.
    As of yet, no solution has been posted. I also received a message from Adobe's Tech Support that it was forwarded to their engineers.
    Still waiting.

  • Finding Hidden PDF files created by iPhoto/Book

    early last year there was a discussion concerning the hidden high res pdf files created by Book in iPhoto. I've searched for it with no luck. I want to use the pages I create in Book for Quicktime Slideshows, as I did then. Is this still possible with iPhoto 6 and if so does anyone know where they are hidden now? I did right click on the book and save a pdf of the book but the res does not seem very high.

    It's been a while since you guys were on this topic, but here's my 2 cents.
    Wanting to see a PDF of my book to check on some text wrap issues, I did click "buy now" last night and cancelled as soon as the book was done assembling and iPhoto started the upload. Didn't receive an e-mail thanking me for my order, so I figured things were fine.
    This morning, I discovered a "pending transaction" to Apple on my bank account, and I am currently waiting to see if it will actually go through or not. When calling Apple Customer service, they told me my credit card was probably "pinged" because the order was started, but the charge may "fall off" because the upload was aborted. If I wanted to know for sure, I had to e-mail iPhoto support (calling wasn't possible), and could expect a response within 48 hrs. Well, within that time frame I will be able to see for myself what happens with that charge, but in the meantime the amount is deducted from my balance. So for anyone out there wondering what happens when you click "buy now," there you go.
    The good news is, I did get the desired PDF file. I compared it with the file that "File>Print" generates and the only differences I see in a quick comparison are:
    - File>Print does not include the blank pages (inside covers and back page), so I end up with 55 pages instead of 58, and the file size is slightly smaller (46.6MB compared to 47.2MB)
    - File>Print's PDF shows 792x612 dimensions (under "get info"), compared to Buy Now's 797.76001 x 617.76001. I have no idea what that is about. Maybe a bleed or something?
    Hope this helps someone.

  • Problems opening .pdf files created in Windows in MAC

    My clients that are using Macs are having problems opening password protected PDFs that I created in Windows. Any suggestions?

    Are your clients using Adobe Reader on Mac, or the built-in Mac OS Preview?  Preview does NOT support the full PDF standard :(.
    From: Adobe Forums <[email protected]<mailto:[email protected]>>
    Reply-To: "[email protected]<mailto:[email protected]>" <[email protected]<mailto:[email protected]>>
    Date: Mon, 26 Sep 2011 15:04:18 -0700
    To: Leonard Rosenthol <[email protected]<mailto:[email protected]>>
    Subject: Problems opening .pdf files created in Windows in MAC
    Problems opening .pdf files created in Windows in MAC
    created by Hollcy<http://forums.adobe.com/people/Hollcy> in PDF Language and Specifications - View the full discussion<http://forums.adobe.com/message/3939175#3939175

  • Mavericks CPU can't open pdf files created on Yosemite

    I've looked around for this issue, but I haven't seen any questions similar to mine.
    My wife and I have identical MacBook Pros. Hers is running Mavericks, while I've updated mine to Yosemite.
    By chance, we realized that if I email her files created on my laptop, she can't open them. I've sent her Pages files, and the same files converted to PDF. So, either on Preview or Pages, she cannot open those files I've sent her.
    I know that the easy answer is "update your wife's laptop to Yosemite," but I'm rather curious whether there's a bug in the system that hasn't been discovered. Besides, my wife is quite happy with Mavericks, and that's fine by me.
    Any help or suggestion in this regard will be greatly appreciated.
    Regards,
    BK

    I just tested opening a Pages v5.5.1 file on Yosemite and Exporting it to a PDF file. Then I copied the PDF and Pages files over to another Mac running Mavericks and I was able to open and view the PDF file. I can't open the actual Pages file in Mavericks created in Yosemite because the Pages app is a different version in Mavericks (v5.2.2) and not compatible with the Yosemite version. But, PDFs definitely work fine and I can also open/view the same PDF file on a Mac running Mountain Lion. So, Preview in Mavericks and Mountain Lion, for me, open and view PDF files created from Yosemite/Pages without issue.
    Have you tried opening your PDF file on another Mac running Mavericks?
    You might try reinstalling Mavericks on top of itself. Maybe Preview in Mavericks is somehow corrupt. On the Mavericks Mac, you can redownload/reinstall Mavericks from the App Store using the same Apple ID that originally downloaded it. Or restart the Mavericks Mac into the Recovery HD (Command+R) and Reinstall OS X from there. Back up before you do the reinstall. The reinstall won't harm any data or apps. It just installs the OS over itself.

  • How to send emails from of pdf's generated by oracle reports

    I have several pdf documents , I want to email those pdf's . Please let me know how to send emails from oracle reports .
    Thanks,
    Previn

    I have integrated Oracle Reports with Oracle Portal and used the scheduling feature via portlets. We have reports that run every monday morning for management. For more info go to:
    http://otn.oracle.com/products/reports/htdocs/getstart/demonstrations/index.html
    OR
    I think if you set destype=mail, desformat=PDF, and desname=[email protected] that should also do the trick.
    Just be sure that you have put your mail server's IP address in the rep_<machine_name>.conf file located in your <oracle_home>/reports/conf directory. If this is not set up, the mail feature won't work.
    Martin

Maybe you are looking for

  • K7N2 Delta (ILSR) incompatible with 200FSB?

    Is the K7N2 Delta (Nforce2 Chipset) incompatible with 200FSB??... Ive seen many problems when trying to upgrade the CPU, and use a 200FSB in various forums. So, why does it keep hanging/crashing?? Might it be not really supported even though it speci

  • Open AUC Line Items

    Hi My requirement is to upload the legacy open AUC line items into the new system. For this we are writing a ABAP program. I could find all the AUC line items in the Table ANEP. But my requirement is to extract only the open AUC line items and not al

  • How to use change document for AUSP table in MM02?

    Hi All, I am working with MM02. When I change the characteristic value in classification view, I want that change to be logged in CDHDR table. I have created a change document object for AUSP table and generated update program for that. Now that prog

  • How do I get a scandisk out of the DVD slot?

    Accidentally put a Scandisk into the DvD slot on my iMac.  (The two slots are too close together, by the way)  How do I get it out?  Can't seem to reach it with a paper clip.

  • ADF page unload

    Is it possible in to trigger action in backing bean on page unload event?