void AddImage(HPDF_Doc pdf, HPDF_Page page, const CString& imagePath)
{
HPDF_Image image = HPDF_LoadPngImageFromFile(pdf, CStringA(imagePath));
if (!image)
{
AfxMessageBox(_T("Error: Cannot load image."));
return;
}
HPDF_REAL width = HPDF_Image_GetWidth(image);
HPDF_REAL height = HPDF_Image_GetHeight(image);
HPDF_Page_DrawImage(page, image, 50, 500, width, height);
}
void CMainViewWnd::ExportToPDF(const CString& filePath)
{
HPDF_Doc pdf = HPDF_New(NULL, NULL);
if (!pdf)
{
AfxMessageBox(_T("Error: Cannot create PdfDoc object."));
return;
}
if (HPDF_SetCompressionMode(

最低0.47元/天 解锁文章
504

被折叠的 条评论
为什么被折叠?



