This discussion is archived
1 2 Previous Next 27 Replies Latest reply: Jun 4, 2012 8:28 AM by brian.mcginity Go to original post RSS
  • 15. Re: Does anyone uses PL_FPDF?
    mobra Journeyer
    Currently Being Moderated
    brian.mcginity wrote:
    I am also working with pl_fpdf. If anyone else is testing this, one word of caution.

    There is a function p_dochecks which does:
    execute immediate 'alter session set NLS_NUMERIC_CHARACTERS = '',.'''

    In a web environment with pooling, this caused other sessions to randomly throw Character to Numeric conversion errors. The solution is to comment this line.
    I've noticed this as well, and I've commented out this line as well. The package seems to work fine without it.
    I’ve also altered the package to make it work with clobs and javascript. Seems to be working. It would be nice to collaborate with others as I’m sure we’re all pretty much fixing the same problems.
    Yes, let's collaborate on this, and make it part of the Alexandria Library for PL/SQL.

    You can go to the Issues page, create a new issue, and add your code as an attachment to the issue:

    http://code.google.com/p/plsql-utils/issues/list


    Then I will try to merge the fixes from different contributors together.

    - Morten

    http://ora-00001.blogspot.com
  • 16. Re: Does anyone uses PL_FPDF?
    654291 Newbie
    Currently Being Moderated
    I've uploaded my version of the Package. It's attached to "Issue 1".

    http://code.google.com/p/plsql-utils/issues/detail?id=1
  • 17. Re: Does anyone uses PL_FPDF?
    brian.mcginity Newbie
    Currently Being Moderated
    I've uploaded my changes: http://code.google.com/p/plsql-utils/issues/detail?id=2

    Main change is the code uses a clob datatype to overcome the 32k limit. Also there is a hook for pdf javascript. I need this for auto printing the pdf on open.
  • 18. Re: Does anyone uses PL_FPDF?
    877814 Newbie
    Currently Being Moderated
    Hallo Dramus,


    I am also usig PL_FPDF with some problems...
    one is (or was?) multiple links on one page.
    I saw you solved it! Can you give me a download of the solution, please?

    Anonther problem I encounter is when texts become larger than 2000 char.
    (and they sometimes do)
    MultiCell uses a variable of type "txt" which is varchar2(2000)
    How to proceed if the text in the (multi)cell is longer?
    Do you have any suggestions?

    Regards,

    Henk Op den Brouw
    Tilburg University

    (but I am already happy with the download :)
  • 19. Re: Does anyone uses PL_FPDF?
    brian.mcginity Newbie
    Currently Being Moderated
    I just started looking at multiCell and ran into the same error due to txt being only 2000. I just changed it to: txt varchar2(32000) and this fixed the problem for me, see if this works.

    I need to create a table of multiCells and will see if I can get a variation of this working: http://www.fpdf.org/en/script/script3.php

    Morten is keeping a copy of the coloration of the updates, go to his site to get a copy:
    http://code.google.com/p/plsql-utils/downloads/list

    Look at PDFGEN_PKG in the "extras" folder.

    Edited by: brian.mcginity on Aug 11, 2011 11:05 PM
  • 20. Re: Does anyone uses PL_FPDF?
    brian.mcginity Newbie
    Currently Being Moderated
    I’ve done a bit more work on the pdf functions. I converted the NbLines function so that multicell tables will page break correctly. Also I’ve created custom th and td functions with style capabilities.

    Also I needed the pdf retuned as a blob, so I overloaded the Output function. I’ve uploaded the changes in the Issue section: http://code.google.com/p/plsql-utils/issues/detail?id=5
  • 21. Re: Does anyone uses PL_FPDF?
    brian.mcginity Newbie
    Currently Being Moderated
    Found another bug in the fpdf library. The Cell function cannot display “(“ or “)“ characters. Here’s how to fix:

    In the Cell procedure, comment out these lines:
    --myTXT2 := str_replace('\\','\\\\',ptxt);
    --myS := myS || 'BT '||tochar((x+myDX)*myK,2)||' '||tochar((h-(y+.5*ph+.3*fontsize))*myK,2)||' Td ('||myTXT2||') Tj ET';
    Add this line under the above line:
    myS := myS || 'BT '||tochar((x+myDX)*myK,2)||' '||tochar((h-(y+.5*ph+.3*fontsize))*myK,2)||' Td ('||p_escape(ptxt)||') Tj ET';
  • 22. Re: Does anyone uses PL_FPDF?
    jstem1177 Explorer
    Currently Being Moderated
    Hello,

    I know that probably no one is following this thread anymore, but I've been trying to find a way to just pass a PNG blob to the current page. There is AS_MINI package that does great work of adding (PNG,IMG,JPG) and nice way of saving things but lacks some features I'm already using.

    I've seen the alexandria project by Morten, which is awesome, and I was wondering if any had thought to merge the image functionality into the PL_FPDF. My lack of programming experience has brought me to a stand still.

    Where can one make this merge request?

    Jan S.
  • 23. Re: Does anyone uses PL_FPDF?
    mobra Journeyer
    Currently Being Moderated
    I've seen the alexandria project by Morten, which is awesome, and I was wondering if any had thought to merge the image functionality into the PL_FPDF. My lack of programming experience has brought me to a stand still.

    Where can one make this merge request?
    Hi Jan,

    you can add your request to the issue list here:

    http://code.google.com/p/plsql-utils/issues/list

    And by the way, which features of PL_FPDF are you using that are not in the AS_MINI package (included as PDF_BUILDER_PKG in the Alexandria Library) ? It might be as easy to port features the other way, depending on what you need.

    - Morten

    http://ora-00001.blogspot.com
  • 24. Re: Does anyone uses PL_FPDF?
    jstem1177 Explorer
    Currently Being Moderated
    Hello Morten,

    Actually I'm using quite a few features, such as:

    - Auto page break --> Just makes life easier then having to calculate the y position
    - Header, footer --> Most people require this and would be awesome to have it with an image
    - Page number --> I don't rememebr the last time I read a document without a page numbers
    - Title , Subject, Author
    - Set X, Set Y --> Realy nice when you are dealing with complex layouts
    - Table/Grids --> Far far simpler in pdfgen espcially when you have multiple tables (no fussing around with rectangles etc

    I would like to emphasize that I also followed your tutorial, and I truely find that dealing with a table/grid from "select" is far far simpler in the pl_pdf. Especially when you have more then one table in your form. Page positioning is also simpler I find.

    I will certainly add the enhancements to the alexandria project. I do not know how to use the jsAutoPrint but that woudl be nice to know.

    Thanks

    Jan S.
  • 25. Re: Does anyone uses PL_FPDF?
    brian.mcginity Newbie
    Currently Being Moderated
    I’ve been slowly changing FPDF to suit my application. At Jan’s request, I just got image processing working for Oracle XE by merging Anton Scheffer’s AS_PDF image functions along with a few fixes.

    The code is available here: http://databaseknowledge.com/services.htm The package is called WPDF (most of my libraries start with W)

    List of fixes and enhancements:

    - Each page is stored as a clob for unlimited page sizes
    - Ability to retrieve the pdf as a blob for storage or email attachment
    - Multi-cell functionality with intelligent page breaking
    - TH/TD functions for creating tables
    - TH/TD Styles for align:left; align:right ;align:center; font-family, font-size, colspan, line-height
    - Standardized page header
    - .jpg and .png image processing compatible with Oracle XE
    - Images can be passed in as blob, base64 clobs or varchar2

    I’ve been using the code in production for more than a year and it’s been reliable. There is still a document size limitation (I’ve yet to reach it) because the pdf’s table of contents structure is stored as a varchar2 32k. I'm guessing somehwere in the 1000s of pages. Also not all images are compatible. I have no idea why a browser can accept and display all sorts of images where as Adobe’s PDF accepts only two: .jpg and raw. So most images need to undergo a transformation to be converted to raw. Presently, WPDF can handle .jpg and basic .png images.

    Hope this helps...

    Brian
    brian@databaseknowledge.com
  • 26. Re: Does anyone uses PL_FPDF?
    ascheffer Expert
    Currently Being Moderated
    I've been changing as_pdf too, see http://technology.amis.nl/?p=17718
    Now also support for gif-images, but also ttf-fonts and other character sets and much more.
  • 27. Re: Does anyone uses PL_FPDF?
    brian.mcginity Newbie
    Currently Being Moderated
    I’ve added a few more functions and capabilities to WPdf and fixed a few more problems with varchar2(32000) limitations. Also I added a version number to keep track of the changes.

    The code is here: http://www.databaseknowledge.com/services.htm and the current version is 1.4.2a

    Also I found a security issue. The way the custom headers and footers are generated is by passing the name of the procedure you wish to execute. The code will then execute this functoin with each new page. A hacker with a hefty amount of skill might be able to construct a url which could execute any procedure in scope.

    I’ve adjusted code in v1.4.2.a which will prevent access to SetHeaderProc() and SetFooterProc() from the url.

    Even still, in production environments, anyone using WPdf,  PL_FPDF or any variant of the code should not make this code accessible directly from the url.


    To do this make sure you implement: PlsqlRequestValidationFunction or or add more rules to PlsqlExclusionList, or use the AUTHORIZE function (Custom OWA is nice).

    For further instruction of how to do this read: http://docs.oracle.com/cd/E15523_01/portal.1111/e12041/secure.htm

    Edited by: brian.mcginity on Jun 4, 2012 8:28 AM
1 2 Previous Next

Legend

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