Further to my previous reply ...
I'm not clear what you mean by "peperport documents" but
extracting PDFs from a General field is fairly straightforward,
with a few important exceptions.
If you use the methodology described in the KB article - IOW
copy each record to a temporary table, you can then peek into
the temp table's FPT file to extract the PDF file.
Unlike the BMP example in the KB article, it's easy to determine
the beginning and end of the PDF file data in the FPT file.
All properly formed PDF files start with "%PDF-" and end with
"%%EOF", so you *could* ...
Load the temp table's FPT into a character variable using
FileToStr();
Use StrExtract() to extract the PDF data into another
character variable;
Then use StrToFile() to create your PDF file.
Main problem with this approach is that if the temp table's
FPT is greater than 16777184 bytes, FileToStr() won't work
as it exceeds VFP's system capacities.
So here's a workaround:
Assume you've created a temporary table (per KB article)
called "pdftest.dbf" ...
<Code>
Create Cursor temp (pdfdata M NoCPTrans)
Select temp
Append Blank
Append Memo pdfdata From pdftest.fpt Overwrite
* Create an empty pdf file
StrToFile("","test.pdf")
lnStartPos = 1
lgStartFile = .F.
Do While .T.
lcChunk = Substr(pdfdata,lnStartPos,CHUNK_SIZE)
If ! lgStartFile
lnFileStartPos = At("%PDF-",lcChunk,1)
If lnFileStartPos > 0
lgStartFile = .T.
lnFileEndPos = At("%%EOF",lcChunk,1)
If lnFileEndPos > 0
lcChunkToWrite = Substr(lcChunk,lnFileStartPos,lnFileEndPos-lnFileStartPos+5)
Else
lcChunkToWrite = Substr(lcChunk,lnFileStartPos)
EndIf
StrToFile(lcChunkToWrite,"test.pdf",1)
EndIf
Else
lnFileEndPos = At("%%EOF",lcChunk)
If lnFileEndPos > 0
lcChunkToWrite = Substr(lcChunk,1,lnFileEndPos + 4)
StrToFile(lcChunkToWrite,"test.pdf",1)
Exit
Else
StrToFile(lcChunk,"test.pdf",1)
EndIf
EndIf
lnStartPos = lnStartPos + CHUNK_SIZE
EndDo
</code>
OK, there are potential problems with this approach.
For example, if your embedded PDF contains PDF sample
data ("%PDF-" or "%%EOF") but that's just one of the
problems of using General fields.
Another problem might occur if the PDFs were appended
to the General field when Acrobat wasn't the default
PDF handler. I noticed this when I had Foxit Reader
installed. If that's the case, bad luck.
-Roger