Get content from PDF file.
XFRX version: 19.0
Code Block |
---|
pdfReader::GetContent(m.liPage, m.luDest, m.liFlag, m.lcFileName) |
...
liPage
Number of page. If value is -1, then reader read content from all pages .
m.luDest
Specifies output type. Can be VFP memory variable, flat file or reference to XFRX#DRAW, XFRX#XML and PDFL#INIT object.
Type | Text | Rectangle | Horizontal and vertical line | Images | Other lines and curves | Append mode for destination |
---|---|---|---|---|---|---|
Variable | Yes | No | No | No | No | Yes |
Flat file | Yes | No | No | No | No | Yes |
XFRX#DRAW | Yes | Yes | Yes | Yes | No | Yes |
XFRX#XML | Yes | Yes | Yes | Yes | No | No |
PDFL#INIT | Yes | Yes | Yes | Yes | Yes | Yes |
m.liFlag
Bit | Value | Description |
---|---|---|
0 | 1 | append mode for content |
9 | 512 | output is file |
10 | 1024 | output is XFRX#DRAW, XFRX#XML and PDFL#INIT object |
m.lcFileName
Output file name for XFRX#DRAW, XFRX#XML, PDFL#INIT
Return value
Boolean.
.T. if content readed or .F. if not.
...
Code Block |
---|
m.loPDFR = EVALUATE([xfrx("PDF#READER")]) *m.loPDFR.SetPasswords("owner","user") && set password for pdf file m.lcFile="BASE-UNI.pdf" IF m.loPDFR.openDocument(m.lcFile) < 0 RETURN ENDIF m.lnError=m.loPDFR.ReadDocument() LOCAL m.loXML, m.loSessionloPDFL m.loPDFL=EVALUATE([xfrx("PDFL#INIT")]) m.loSession=EVALUATE([xfrx("XFRX#INIT")]) * create new PDF file m.loPDFR.GetContent(1, m.loPDFL, 1024+0, lcfile+".pdf") m.loPDFR.GetContent(2, m.loPDFL, 1024+1, lcfile+".pdf") m.loXMLloPDFL.FinishDocument() * Append to existing PDF file m.loPDFL.CreateDocument(lcfile+".pdf", .T.) m.loPDFL.SetOtherParams("DONOTZIPTEXTSTREAM",.T.) m.loPDFR.GetContent(1, m.loPDFL, 1024+1) m.loPDFR.GetContent(2, m.loPDFL, 1024+1) m.loPDFL.FinishDocument() m.loPDFR.closeDocument() |
...