![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hello I have a particular set of PDF files that cannot be loaded successfully into an Oracle BLOB column. |
#3
| |||
| |||
|
|
On Mar 15, 1:36*pm, "Syltrem" <syltremz... (AT) videotron (DOT) ca> wrote: Hello I have a particular set of PDF files that cannot be loaded successfullyinto an Oracle BLOB column. Do you have an actual error message? |
#4
| |||
| |||
|
|
Hello I have a particular set of PDF files that cannot be loaded successfully into an Oracle BLOB column. Do you have an actual error message? |
#5
| |||
| |||
|
|
No error. It's just that some extra characters are added into the BLOB. For instance, I see that a 0A is added following each 0C (LineFeed added following each FormFeed). So if the PDF contains 50 FormFeeds, then 50 LineFeeds are added, making 50 characters to be truncated from the end of the file (the BLOB length always matches the file's length). And the problem is with INSERTING the file into the BLOB. The extraction from Oracle is not the problem, which I can prove by loading the same PDF with a dot net program, and extracting it successfully with the same extraction procedure. dbms_lob.loadBLOBfrofile does the damage. This is with 10.2.0.4 Yesterday, I downloaded Acrobat Pro trial version. I created a new PDF file with it (from a MS-Word document), loaded it into Oracle, and could not retrieve it in good condition. I have not gone into the details yet but I suspect the same problem. Strangely, I have other PDF coming from different sources, that work without problem. Actually, I was surprised that I could not use a PLSQL program that I used for a couple of years to load other PDFs, to load these new ones. Can't tell what Oracle does not like about these new ones. And yes I see there are many example out there showing how to load and extract PDF with Oracle, but non mentions that some PDF (nor any other file types) are not "supported". Thanks Syltrem |
#6
| |||
| |||
|
|
No error. It's just that some extra characters are added into the BLOB. For instance, I see that a 0A is added following each 0C (LineFeed added following each FormFeed). So if the PDF contains 50 FormFeeds, then 50 LineFeeds are added, making 50 characters to be truncated from the end of the file (the BLOB length always matches the file's length). And the problem is with INSERTING the file into the BLOB. The extraction from Oracle is not the problem, which I can prove by loading the same PDF with a dot net program, and extracting it successfully with the same extraction procedure. dbms_lob.loadBLOBfrofile does the damage. This is with 10.2.0.4 Yesterday, I downloaded Acrobat Pro trial version. I created a new PDF file with it (from a MS-Word document), loaded it into Oracle, and could not retrieve it in good condition. I have not gone into the details yet but I suspect the same problem. Strangely, I have other PDF coming from different sources, that work without problem. Actually, I was surprised that I could not use a PLSQL program that I used for a couple of years to load other PDFs, to load these new ones. Can't tell what Oracle does not like about these new ones. And yes I see there are many example out there showing how to load and extract PDF with Oracle, but non mentions that some PDF (nor any other file types) are not "supported". Thanks Syltrem Not sure if I posted this properly, so will try again: Do you have any O/S details? Could it be a MS Windows / Unix CR/LF conversion issue? HTH -g |
#7
| |||
| |||
|
|
"gazzag" <gar... (AT) jamms (DOT) org> wrote in message news:828ea98b-bb94-4ee2-88f3-43b037836f54 (AT) k9g2000yqi (DOT) googlegroups.com... On Mar 17, 1:34 pm, "Syltrem" <syltremz... (AT) videotron (DOT) ca> wrote: No error. It's just that some extra characters are added into the BLOB. For instance, I see that a 0A is added following each 0C (LineFeed added following each FormFeed). So if the PDF contains 50 FormFeeds, then 50 LineFeeds are added, making 50 characters to be truncated from the end of the file (the BLOB length always matches the file's length). And the problem is with INSERTING the file into the BLOB. The extraction from Oracle is not the problem, which I can prove by loading the same PDF with a dot net program, and extracting it successfully with the same extraction procedure. dbms_lob.loadBLOBfrofile does the damage. This is with 10.2.0.4 Yesterday, I downloaded Acrobat Pro trial version. I created a new PDF file with it (from a MS-Word document), loaded it into Oracle, and could not retrieve it in good condition. I have not gone into the details yet butI suspect the same problem. Strangely, I have other PDF coming from different sources, that work without problem. Actually, I was surprised that I could not use a PLSQL program that I used for a couple of years to load other PDFs, to load these new ones.. Can't tell what Oracle does not like about these new ones. And yes I see there are many example out there showing how to load and extract PDF with Oracle, but non mentions that some PDF (nor any other file types) are not "supported". Thanks Syltrem Not sure if I posted this properly, so will try again: Do you have any O/S details? *Could it be a MS Windows / Unix CR/LF conversion issue? HTH -g Production is on OpenVMS 8.4 / Itanium but I also tried with Windows XP, Oracle XE and got the same problem. Syltrem |
#8
| |||
| |||
|
|
"gazzag" <gar... (AT) jamms (DOT) org> wrote in message news:828ea98b-bb94-4ee2-88f3-43b037836f54 (AT) k9g2000yqi (DOT) googlegroups.com... On Mar 17, 1:34 pm, "Syltrem" <syltremz... (AT) videotron (DOT) ca> wrote: No error. It's just that some extra characters are added into the BLOB. For instance, I see that a 0A is added following each 0C (LineFeed added following each FormFeed). So if the PDF contains 50 FormFeeds, then 50 LineFeeds are added, making 50 characters to be truncated from the end of the file (the BLOB length always matches the file's length). And the problem is with INSERTING the file into the BLOB. The extraction from Oracle is not the problem, which I can prove by loading the same with a dot net program, and extracting it successfully with the same extraction procedure. dbms_lob.loadBLOBfrofile does the damage. This is with 10.2.0.4 Yesterday, I downloaded Acrobat Pro trial version. I created a new PDF file with it (from a MS-Word document), loaded it into Oracle, and could not retrieve it in good condition. I have not gone into the details yet but I suspect the same problem. Strangely, I have other PDF coming from different sources, that work without problem. Actually, I was surprised that I could not use a PLSQL program that I used for a couple of years to load other PDFs, to load these new ones. Can't tell what Oracle does not like about these new ones. And yes I see there are many example out there showing how to load and extract PDF with Oracle, but non mentions that some PDF (nor any other file types) are not "supported". Thanks Syltrem Not sure if I posted this properly, so will try again: Do you have any O/S details? Could it be a MS Windows / Unix CR/LF conversion issue? HTH -g Production is on OpenVMS 8.4 / Itanium but I also tried with Windows XP, Oracle XE and got the same problem. Syltrem How did you get the file onto the OpenVMS server? ftp? Did you use binary mode? - I think that you probably already know that, but just checking. M. ex-DECcie - RDB Rules. |
#9
| |||
| |||
|
|
And yes I see there are many example out there showing how to load and extract PDF with Oracle, but non mentions that some PDF (nor any other file types) are not "supported". |
#10
| |||
| |||
|
|
Hello I have a particular set of PDF files that cannot be loaded successfully into an Oracle BLOB column. declare l_blob BLOB; l_bfile BFILE:=BFILENAME('COPY_DB','ORIGINAL_FILE.PDF'); v_dest_offset integer:=1; v_src_offset integer:=1; begin insert into test values(1,EMPTY_BLOB()) returning pdf into l_Blob; dbms_lob.fileopen(l_bfile,dbms_lob.FILE_READONLY); dbms_lob.loadblobfromfile(dest_lob=>l_Blob, src_bfile=>l_bfile, amount=>dbms_lob.getlength(l_bfile), dest_offset=>v_dest_offset, src_offset=>v_src_offset); dbms_lob.fileclose(l_bfile); commit; end; / select UTL_RAW.CAST_TO_VARCHAR2(dbms_lob.substr(PDF,2000) ) from test; A hexadecimal dump of the original imported file, compared to that of the exported file, also shows the difference. |
![]() |
| Thread Tools | |
| Display Modes | |
| |