Karen,

It is possible to save a PDF in a table.

The command is for instance: SET VAR V_PDF_File VARBIT = (  ['C:\PDF\Report001.pdf'] )

The square brackets and quotes are important.

Then you are able to insert the pdf itself in the table using this variable, the column is also a varbit

I agree it takes some space in de database, but the benefit is that you are fully in control.

Tony

Op 27-11-2025 om 20:44 schreef Tony Luck:
That is correct, you need to set a variable that holds the path to the pdf. On click will then open the pdf in the viewer.

Regards
Tony

On Fri, 28 Nov 2025, 1:25 am 'Karen Tellef' via RBASE-L, <[email protected]> wrote:

    Does your code actually STORE the PDF file in a table?  That's
    what Bob is asking for, and I was under the impression that PDFs
    could not be saved in a table, only a link to their location


    Karen


    On Thursday, November 27, 2025 at 06:54:59 AM CST, Dewan
    Monjoruzzaman <[email protected]> wrote:


    Dear Mr. Dr. Robert Rugilo,

    Greetings.

    We frequently use R:Base to store PDF files in our software. I
    shared my script. I will be pleased if it helps you.

    ----Start
    CLEAR VAR vfile1,vfile2,vcap,iv%

    SET VAR vfile1 TEXT = NULL,vcap TEXT ='Loading PDF'

    CLS

    PLUGINS loadfilename.rbl vfile1 +
    |FULLPATH on |TITLE 'Select file to upload PI Copy' +
    |FILTER image files .BMP,.JPG |FILTER all files *.* +
    |MULTISELECT off |SHOW_HIDDEN off +
    |NO_LONG_NAMES off |OLD_STYLE off +
    |NO_NETWORK_BUTTON off |HIDE_READ_ONLY on +
    |NO_CHANGE_DIR on

    IF vfile1 IS NULL OR vfile1 ='[Esc]' THEN
      RETURN
    ENDIF

    SET VAR vstoring_dt TEXT =((FORMAT(.#DATE,'mmm-yy')))

    SET VAR vdirectory TEXT=('D:\PI\'+.vstoring_dt)

    SET VAR vdir_check INTEGER =(CHKFILE(.vdirectory))

    IF vdir_check = 0 THEN
      SET ERROR MESSAGE 2269 OFF
      MKDIR .vdirectory
      SET ERROR MESSAGE 2269 ON
    ENDIF

    ---Create an URL where the file will be saved. Here 'vpiuid' is my
    PI identificatin no.
    SET VAR vfile2 =(.vdirectory+'\'+(CTXT(.vpiuid))+'.pdf');

    SET ERROR MESSAGE 2077 OFF
    --If already exist
    ERASE .vfile2
    --Copy the file to the directory
    COPY .vfile1 .vfile2
    SET ERROR MESSAGE 2077 ON

    --Update the file url in a column of a table. Also record the user
    who stores the file and the storing date.
    UPDATE pi_upload SET pi_pdf =.vfile2,upl_by =.vuid,upl_dt =.#now
    WHERE piuid =.vpiuid

    RECALC

    --To retrieve the file in a PDF viewer
    IF vpi_pdf IS NOT NULL THEN
      PROPERTY pi_pdf FILENAME .vpi_pdf
    ELSE
      SET VAR vblank_file TEXT = 'D:\utah\pi\blank.pdf'

      PROPERTY pi_pdf FILENAME .vblank_file
    ENDIF
    RETURN
    ----End

    To retrieve the file in a PDF viewer placed in a form. Please add
    the code in the EEPs.

    ---Start

    IF vpi_pdf IS NULL THEN
      PAUSE FOR 2 USING 'PI not yet Uploaded' CAPTION 'Warning!' ICON stop
    ELSE
      LAUNCH .vpi_pdf |||MAXIMIZED
    ENDIF

    RETURN

    ---End

    image.png


    Best regards,

    Dewan Monjoruzzaman

    Manager Software | Utah Group

    M: +8801916864347

    W: http://www.utahgroup.com



    On Thu, Nov 27, 2025 at 3:28 AM [email protected]
    <[email protected]> wrote:

        Hello everyone, I have used R:base to store all kinds of
        images (BMP,PNG,JPG,ICO, etc)
        without a problem, but it seem that I missed out the class on
        how to store and retrieve a PDF file.
        Is there anyone who has done that (I imagine the answer is
        yes)  and care to tell me what I'm doing wrong?
        Thank you in advance for the help you can give me.
        Dr. Robert Rugilo
-- For group guidelines, visit
        http://www.rbase.com/support/usersgroup_guidelines.php
        ---
        You received this message because you are subscribed to the
        Google Groups "RBASE-L" group.
        To unsubscribe from this group and stop receiving emails from
        it, send an email to [email protected].
        To view this discussion visit
        
https://groups.google.com/d/msgid/rbase-l/cc100161-466b-494f-9f37-bbfce51c8a10n%40googlegroups.com
        
<https://groups.google.com/d/msgid/rbase-l/cc100161-466b-494f-9f37-bbfce51c8a10n%40googlegroups.com?utm_medium=email&utm_source=footer>.

-- For group guidelines, visit
    http://www.rbase.com/support/usersgroup_guidelines.php
    ---
    You received this message because you are subscribed to the Google
    Groups "RBASE-L" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected].
    To view this discussion visit
    
https://groups.google.com/d/msgid/rbase-l/CAOkDjxfNyampC-FByN85FTPisgu%2BU0uNMch0ZjV5TiyE69ZW-Q%40mail.gmail.com
    
<https://groups.google.com/d/msgid/rbase-l/CAOkDjxfNyampC-FByN85FTPisgu%2BU0uNMch0ZjV5TiyE69ZW-Q%40mail.gmail.com?utm_medium=email&utm_source=footer>.
-- For group guidelines, visit
    http://www.rbase.com/support/usersgroup_guidelines.php
    ---
    You received this message because you are subscribed to the Google
    Groups "RBASE-L" group.
    To unsubscribe from this group and stop receiving emails from it,
    send an email to [email protected].
    To view this discussion visit
    
https://groups.google.com/d/msgid/rbase-l/475169385.71858.1764257140758%40mail.yahoo.com
    
<https://groups.google.com/d/msgid/rbase-l/475169385.71858.1764257140758%40mail.yahoo.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit http://www.rbase.com/support/usersgroup_guidelines.php
---
You received this message because you are subscribed to the Google Groups "RBASE-L" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion visit https://groups.google.com/d/msgid/rbase-l/CABnhDARrLtiNFGGa95xx%3DAVQZ4UBFMJvUxEhB3EtbD-EjOaN7A%40mail.gmail.com <https://groups.google.com/d/msgid/rbase-l/CABnhDARrLtiNFGGa95xx%3DAVQZ4UBFMJvUxEhB3EtbD-EjOaN7A%40mail.gmail.com?utm_medium=email&utm_source=footer>.

--
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- You received this message because you are subscribed to the Google Groups "RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/rbase-l/ee67dd95-d6f6-47d7-b756-15edfe485469%40cio-bv.nl.

Reply via email to