1. Sajith Prasannan
  2. PowerBuilder
  3. Wednesday, 22 November 2023 06:26 AM UTC

Dear Developers,

Please provide guidance on the issue I'm encountering in my project.


I have a .pdf file that has been compressed with zip.exe and stored in a table as a blob.
I need to extract this file in PowerBuilder 2022 R2 using the 'Extract' function to retrieve the original .pdf file, but I have encountered difficulties.


Code used to extract the file:

ExtractorObject lnv_extractor
Integer li_return
blob lb_source, lb_extract
String ls_msg
//
lb_source=ab_compress_blob_data
lnv_extractor = create ExtractorObject
li_return = lnv_extractor.extract (ab_compress_blob_data, lb_extract, ArchiveFormatZIP!)

 

The 'li_return' is returning as 1, and the file is being created. However, upon attempting to open it, the following message is encountered:

"Adobe Reader could not open 'test.pdf' because it is either not a support file type or because the file has been damaged (for example, it was sent as an email attachment and wasn't correctly decoded)."

 

 

Thanks in advance, 

Sajith Prasannan 

Accepted Answer
Chris Pollach @Appeon Accepted Answer Pending Moderation
  1. Wednesday, 22 November 2023 16:23 PM UTC
  2. PowerBuilder
  3. # Permalink

Hi Sajith ;

  It could also be a possibility that A) the Zipped PDF file was improperly stored in the DBMS Table Blob column or B) The BLOB data was incorrectly (partially) retrieved from the DBMS. If either were the case, then the PDF would be unreadable after the Extract.  Food for thought.

Regards ... Chris

Comment
  1. John Fauss
  2. Wednesday, 22 November 2023 17:19 PM UTC
I agree with Chris. I would perform two tests: 1. Make a copy of an existing, valid PDF file for testing purposes. Verify that it can be viewed in web browser or Acrobat Reader, etc. Zip the PDF, then unzip it with the PB Extractor object and compare the unzipped PDF with the original. That will tell you if the Extractor functionality is working correctly, which I suspect it is. 2. Retrieve a PDF/Blob from the database and write the zipped PDF to disk. Try to unzip it with WinZip or similar utility and see if it is in usable shape.
  1. Helpful 1
  1. Sajith Prasannan
  2. Thursday, 23 November 2023 06:15 AM UTC
Thank you, Mr. John, for the detailed troubleshooting steps.
  1. Helpful
There are no comments made yet.
Sajith Prasannan Accepted Answer Pending Moderation
  1. Thursday, 23 November 2023 06:14 AM UTC
  2. PowerBuilder
  3. # 1

Thank you for your reply. I re-verified the code and it's working fine now. Apologies for the confusion caused.

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.