I ask for help and suggestions to resolve this issue.
In an accounting gnucobol application I would like pdf attachments to be stored.
for example to an accounting document I would like to associate the .pdf file of the invoice of one or more pages.
how can I save into an indexed file (bdb or vbisam) both normal pic x or pic 9 fields and a further field that contains the .pdf file?
maybe I must first transform the binary of the .pdf into a character eg. in base64 and then move it to a pic x field that is large enough ... and in this case for the size of the pic x field what would be the maximum size limit ...
Does anyone know how to do ?
thanks in advance for your tips and advice.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I keep the pdf document in a separate directory broken down into multiple directories in order to keep the number of entries per directory less than 255. Then only the pdf location and file name is kept in the cobol file.
One strategy is to file pdfs by year/month. Another assuming the pdf file name represents the invoice number, file by the low order two digits (mod(invoice_number,100) of the invoice number so you will have 100 directories and able to store 25000 invoices without causing poor seek performance.
Use:
01 SHOW-COMMAND.
03 FILLER PIC X(12) VALUE "explore,exe ".
03 SHOW-PATH PIC X(36)
STRING AR-PATH, AR-INVOICE-PDF INTO SHOW-PATH
CALL SYSTEM USING (SHOW-COMMAND)
Byusingexplore.exeinsteadofacrobat,theprogramselectedtoviewthedocumentwillbebasedontheuser's file extension preference. This of course assumes the cobol program is running on the workstation. If not, I can suggest other methods.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I ask for help and suggestions to resolve this issue.
In an accounting gnucobol application I would like pdf attachments to be stored.
for example to an accounting document I would like to associate the .pdf file of the invoice of one or more pages.
how can I save into an indexed file (bdb or vbisam) both normal pic x or pic 9 fields and a further field that contains the .pdf file?
maybe I must first transform the binary of the .pdf into a character eg. in base64 and then move it to a pic x field that is large enough ... and in this case for the size of the pic x field what would be the maximum size limit ...
Does anyone know how to do ?
thanks in advance for your tips and advice.
I keep the pdf document in a separate directory broken down into multiple directories in order to keep the number of entries per directory less than 255. Then only the pdf location and file name is kept in the cobol file.
One strategy is to file pdfs by year/month. Another assuming the pdf file name represents the invoice number, file by the low order two digits (mod(invoice_number,100) of the invoice number so you will have 100 directories and able to store 25000 invoices without causing poor seek performance.
Use:
01 SHOW-COMMAND.
03 FILLER PIC X(12) VALUE "explore,exe ".
03 SHOW-PATH PIC X(36)
STRING AR-PATH, AR-INVOICE-PDF INTO SHOW-PATH
CALL SYSTEM USING (SHOW-COMMAND)
I left out the ending of SHOW-COMMAND.
03 FILLER PIC XX VALUE " " & x"00".
Terminates SHOW-COMMAND with a null.