on 05-17-2016 10:29 PM
Good excuse my English, I use the PowerBuilder 10.5 made a query to a database that contains PDF files with SelectBlob and want to transform it to a PDF file returns me corrupt file and double the size.
In PowerBuilder 9.0 if it works, please if you could help me and I'm 2 days with that problem.
The following is the function.
li_numarch = FileOpen (ls_pathname, streamMode !, write !, lockwrite !, Replace!)
li_numarch if <0 then return -1
ll_BlobLen = Len (a_blob)
If ll_BlobLen> 32765 Then
If Mod (ll_BlobLen, 32765) = 0 Then
li_Writes = ll_BlobLen / 32765
else
li_Writes = (ll_BlobLen / 32765) + 1
End if
else
li_Writes = 1
End if
ll_CurrentPos = 1
For li_Cnt = 1 To li_Writes
ls_blob = BlobMid (a_blob, ll_CurrentPos, 32765)
ll_CurrentPos + = 32765
If FileWrite (li_numarch, ls_blob) = -1 Then
FileClose (li_numarch)
FileDelete (ls_pathname)
return -1
end if
Next
FileClose (li_numarch)
Hi Alexander;
There are a few things to consider here in newer versions of PB that are Unicode now vs PB 9.x which was ANSI based. They are as follows:
1) Use the new Encoding parameter on the FileOpen ( ) method to read the PDF file in the correct ANSI for Unicode format.
2) The Blob ( ) methods all have a new Encoding option.
3) Replace the FileRead ( ) method with the FileReadEx() method.
HTH
Regards ... Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
81 | |
9 | |
9 | |
7 | |
7 | |
6 | |
6 | |
6 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.