Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
How to save PDF file in General Field to c:\ drive
Message
From
29/09/2006 17:03:19
 
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
Miscellaneous
Thread ID:
01158204
Message ID:
01158290
Views:
30
>FYI: With VFP9's CAST function, you don't have to create the temp table anymore:
>
>
>** Use CAST instead of temp file
>lcStr = CAST(custfile AS Blob)
>*  COPY TO temp FIELDS custfile NEXT 1
>*  lcPdfFileName = "cust_hist.pdf"
>*  lcStr = FILETOSTR("temp.fpt")
>lnStartPos = AT( "%PDF", lcStr)
>lnEndPos = RAT( "%%EOF", lcStr) + 5
>lcPdfStr = SUBS(lcStr, lnStartPos, lnEndPos - lnStartPos + 1 )
>STRTOFILE(lcPdfStr, lcPdfFileName)
>
squeezing it more
STRTOFILE(STREXTRACT(CAST(custfile AS W), "%PDF" , "%%EOF") , lcPdfFileName)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform