L_ExtractAttachment

include "l_bitmap.h"

L_LTFIL_APIL_INTL_ExtractAttachment(pszSrcFileName, pSrcBuffer, uSrcBufferSize, pFileOptions, pFileInfo, uFlags, pszDstFileName, ppDstBuffer, puDstBufferSize)

Extracts an attachment from the owner file.

Parameters

L_TCHAR*pszSrcFileName

Owner file name.

If this value is notNULL, then it must point to the name of the file on disk to parse for the attachment.

If this value isNULL, then the owner file data must be set inpSrcBuffer.

EitherpszSrcFileNameorpSrcBuffermust not beNULL, but not both.

L_UCHAR*pSrcBuffer

Pointer to the memory buffer containing the data of the owner file.

If this value is notNULL, then it must contain the data of the owner file to parse for the attachment. The size of the data must be set inuSrcBufferSize.

If this value isNULL, thenpszSrcFileNamemust point to the name of the file on disk to parse for the attachment.

EitherpszSrcFileNameorpSrcBuffermust not beNULL, but not both.

L_SIZE_TuSrcBufferSize

Size ofpSrcBufferin bytes, if the value of the parameter passed is notNULL; otherwise, ignore.

pLOADFILEOPTIONpFileOptions

Pointer to optional extended load options. This value cannot beNULL. The value ofpLOADFILEOPTION->nAttachmentmust be set to the 1-based attachment number to extract.

pFILEINFOpFileInfo

Pointer to aFILEINFOstructure. This structure may contain file information used in loading an image, or it may be updated with information about the file being loaded.

This value can beNULL.

Refer toL_LoadFilefor more information.

L_UINTuFlags

保留以供将来使用。用0。

L_TCHAR* pszDstFileName

Destination file name.

If this value is notNULL, then it must contain the name of the file on disk that will be created or overwritten with the attachment file data, if found.

If this value isNULL, then the attachment file data will be set inppDstBuffer.

EitherpszDstFileNameorppDstBuffermust not beNULL, but not both.

L_UCHAR**ppDstBuffer

Pointer to the variable that will contain the attachment file data, if found.

If this value is notNULL, then it will contain the attachment file data and the size in bytes will be set inpuDstBufferSize. The application code must callL_FreeBufferon the pointer when it is no longer needed.

If this value isNULL, then the attachment file data is saved to the name of the file set inpszDstFileName.

L_SIZE_T*puDstBufferSize

Size of the memory buffer in _ppDstBuffer_, if the value of the parameter passed was notNULL.

Returns

Value Meaning
SUCCESS The function was successful.
ERROR_ATTACHMENT_NOT_FOUND The attachment number specified inpFileOptions->nAttachmentwas not found in the file.
ERROR_PDF_INVALID_PASSWORD The owner file is encrypted. Pass the correct password usingL_SetPDFOptionsand try again.
ERROR_FEATURE_NOT_SUPPORTED The file is a format that does not support attachments (such as PNG or BMP), or LEADTOOLS does not support reading attachments of this type of format.
< 1 An error occurred. Refer toReturn Codes.

Comments

UseL_FILEINFO.nAttachmentCountto quickly determine the number of attachments found in a file.

UseL_ReadFileAttachmentsto obtain the number and properties of all attachments found in a file.

Required DLLs and Libraries

Platforms

Win32, x64, Linux.

LEADTOOLS Raster Imaging C API Help
188金宝搏的网址客服|Support|Contact Us|Intellectual Property Notices
© 1991-2021LEAD Technologies, Inc.All Rights Reserved.