31 lines
765 B
C++
31 lines
765 B
C++
#include "stdio.h"
|
|
#include "base/HGBase.h"
|
|
#include "imgfmt/HGPdf.h"
|
|
#include "imgfmt/HGImgFmt.h"
|
|
#include "imgproc/HGImgProc.h"
|
|
#include "imgproc/HGOCR.h"
|
|
#include "sane_user/HGSane.h"
|
|
|
|
int main()
|
|
{
|
|
HGImage img = NULL;
|
|
HGImgFmt_LoadImage("111.jpg", 0, NULL, HGBASE_IMGTYPE_RGB, HGBASE_IMGORIGIN_TOP, &img);
|
|
if (NULL != img)
|
|
{
|
|
printf("load image success\n");
|
|
|
|
HGPdfImageWriter writer = NULL;
|
|
HGImgFmt_OpenPdfImageWriter("我的.pdf", &writer);
|
|
if (NULL != writer)
|
|
{
|
|
printf("create image writer success\n");
|
|
HGImgFmt_SaveJpegImageToPdfImageWriter(writer, img, NULL);
|
|
HGImgFmt_ClosePdfImageWriter(writer);
|
|
}
|
|
|
|
HGBase_DestroyImage(img);
|
|
}
|
|
|
|
return 0;
|
|
}
|