Subject | AW: [IBO] Re: Storing PDF into Firebird Blobs |
---|---|
Author | Herbert Senner |
Post date | 2012-05-22T15:55:18Z |
Terry,
I would store all these files in the same path, but with different file
names
(e.g. constructed by the key field(s) of your qryScan row, which would
uniquely identify the file and link it to the row).
You might have to check before writing the blob to a file if this concrete
file already
exists and then decide to delete it first and to create it newly (to
"reload") or not
to reread the blob's content and to view this existing file.
Herbert
Von: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] Im Auftrag
von Terry Black
Gesendet: Dienstag, 22. Mai 2012 06:48
An: IBObjects@yahoogroups.com
Betreff: AW: AW: [IBO] Re: Storing PDF into Firebird Blobs
Thanks, Herbert and Jason - the code works well. I can load PDF images into
blob fields. My intention is to just click on a record in a table and have
it display the contents of the blob which is a PDF. But I have a problem
with the Blob being saved to a file.
When I click on the first record
DM.qryScan.FieldByName('PDFIMAGE').SaveToFile(myPath + '\myPdf.pdf') the
first time it creates a file called myPDF.pdf when I click on the second
record I get an EFCreateError ' Cannot create file D:\apdf\mypdf.pdf' the
process cannot access the file because it is being used by another process.
In other words I need to write it to some temporary location.
Terry
[Non-text portions of this message have been removed]
I would store all these files in the same path, but with different file
names
(e.g. constructed by the key field(s) of your qryScan row, which would
uniquely identify the file and link it to the row).
You might have to check before writing the blob to a file if this concrete
file already
exists and then decide to delete it first and to create it newly (to
"reload") or not
to reread the blob's content and to view this existing file.
Herbert
Von: IBObjects@yahoogroups.com [mailto:IBObjects@yahoogroups.com] Im Auftrag
von Terry Black
Gesendet: Dienstag, 22. Mai 2012 06:48
An: IBObjects@yahoogroups.com
Betreff: AW: AW: [IBO] Re: Storing PDF into Firebird Blobs
Thanks, Herbert and Jason - the code works well. I can load PDF images into
blob fields. My intention is to just click on a record in a table and have
it display the contents of the blob which is a PDF. But I have a problem
with the Blob being saved to a file.
When I click on the first record
DM.qryScan.FieldByName('PDFIMAGE').SaveToFile(myPath + '\myPdf.pdf') the
first time it creates a file called myPDF.pdf when I click on the second
record I get an EFCreateError ' Cannot create file D:\apdf\mypdf.pdf' the
process cannot access the file because it is being used by another process.
In other words I need to write it to some temporary location.
Terry
[Non-text portions of this message have been removed]