SaveImage Method

Save image to to file. 

pdfReader::SaveImage(liPage, lcImgID, lcName, @lcSName)

Parameters

liPage
Number of page.

lcImgID
Image ID.

lcName
Image filename.

lcSName
Mask image file name. If value is empty after calling method, then mask image was merged with image.

Return value

Boolean
Return.T. if image save to file, .F. or not.

Remarks

Applies To: PDF#READER

XFRX version: 19.0

Examples

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 ARRAY m.laIMGS(1)
LOCAL m.liImages, m.lcName, m.lcSName
m.liImages=m.loPDFR.GetListImages(-1, @m.laIMGS)
 
* Save first image of first page to file
m.lcName="c:\temp\xx\"+m.laIMGS(1,2)+"."+m.laIMGS(1,3)
m.loPDFR.SaveImage(m.laIMGS(1,1), m.laIMGS(1,2), m.lcName, "")
 
* Save first image of first page to file (+mask image)
IF NOT EMPTY(m.laIMGS(1,4))
   m.lcSName="c:\temp\xx\"+m.laIMGS(1,2)+".msk."+m.laIMGS(1,4)
   m.loPDFR.SaveImage(m.laIMGS(1,1), m.laIMGS(1,2), m.lcName, @m.lcSName)
   IF NOT EMPTY(m.lcSName)
      ?"mask image saved to file"
   ENDIF
ENDIF
  
m.loPDFR.closeDocument()