#ifndef __HGPDF_H__ #define __HGPDF_H__ #include "../base/HGDef.h" #include "../base/HGBaseErr.h" #include "HGImgFmtErr.h" #include "../base/HGImage.h" #include "HGJpeg.h" HG_DECLARE_HANDLE(HGPdfReader); HG_DECLARE_HANDLE(HGPdfImageWriter); #pragma pack(push) #pragma pack(4) typedef struct { HGUInt width; HGUInt height; HGUInt bpp; }HGPdfPageInfo; #pragma pack(pop) HGEXPORT HGResult HGAPI HGImgFmt_CheckPdfFile(const HGChar* fileName, HGBool* isPdf); HGEXPORT HGResult HGAPI HGImgFmt_OpenPdfReader(const HGChar* fileName, HGPdfReader* reader); HGEXPORT HGResult HGAPI HGImgFmt_ClosePdfReader(HGPdfReader reader); HGEXPORT HGResult HGAPI HGImgFmt_GetPdfPageCount(HGPdfReader reader, HGUInt* count); HGEXPORT HGResult HGAPI HGImgFmt_GetPdfPageInfo(HGPdfReader reader, HGUInt page, HGPdfPageInfo *info); HGEXPORT HGResult HGAPI HGImgFmt_LoadImageFromPdfReader(HGPdfReader reader, HGUInt page, HGFloat xScale, HGFloat yScale, HGUInt imgType, HGUInt imgOrigin, HGImage* image); HGEXPORT HGResult HGAPI HGImgFmt_LoadPdfImage(const HGChar* fileName, HGPdfPageInfo *info, HGUInt imgType, HGUInt imgOrigin, HGImage* image); HGEXPORT HGResult HGAPI HGImgFmt_OpenPdfImageWriter(const HGChar* fileName, HGPdfImageWriter* writer); HGEXPORT HGResult HGAPI HGImgFmt_ClosePdfImageWriter(HGPdfImageWriter writer); HGEXPORT HGResult HGAPI HGImgFmt_SaveJpegImageToPdfImageWriter(HGPdfImageWriter writer, HGImage image, const HGJpegSaveInfo* info); HGEXPORT HGResult HGAPI HGImgFmt_SavePdfJpegImage(HGImage image, const HGJpegSaveInfo* info, const HGChar* fileName); #endif /* __HGPDF_H__ */