#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include "handler.h"
#ifdef LIBHPDF_HAVE_LIBPNG
int main (int argc, char **argv)
{
const char *cs;
if (argc < 2) {
printf ("usage: make_rawimage <in-file-name> <out-file-name>\n");
return 1;
}
pdf =
HPDF_New (demo_error_handler, NULL);
if (!pdf) {
printf ("error: cannot create PdfDoc object\n");
return 1;
}
if (setjmp(env)) {
return 1;
}
printf ("width=%u\n", iw);
printf ("height=%u\n", ih);
printf ("bits_per_comp=%u\n", bits_per_comp);
printf ("color_space=%s\n", cs);
if (!stream)
printf ("cannot open %s\n", argv[2]);
else
return 0;
}
#else
int main()
{
printf("WARNING: make_rawimage app was not built correctly. \n"
"Make sure libpng is installed and CMake is able to find it.\n");
return 0;
}
#endif
void HPDF_Free(HPDF_Doc pdf)
Revoke a document object and all resources.
HPDF_Doc HPDF_New(HPDF_Error_Handler user_error_fn, void *user_data)
Create an instance of a document object and initialize it.
HPDF_UINT HPDF_Image_GetWidth(HPDF_Image image)
Get image width of an image object.
const char * HPDF_Image_GetColorSpace(HPDF_Image image)
Get image color space name.
HPDF_Image HPDF_LoadPngImageFromFile(HPDF_Doc pdf, const char *filename)
Load external PNG image file.
HPDF_UINT HPDF_Image_GetBitsPerComponent(HPDF_Image image)
Get bit count used to describe each color component.
HPDF_UINT HPDF_Image_GetHeight(HPDF_Image image)
Get image height of an image object.
HPDF_Stream HPDF_FileWriter_New(HPDF_MMgr mmgr, const char *fname)
void HPDF_Stream_Free(HPDF_Stream stream)
HPDF_STATUS HPDF_Stream_WriteToStream(HPDF_Stream src, HPDF_Stream dst, HPDF_UINT filter, HPDF_Encrypt e)
unsigned int HPDF_UINT
Definition: hpdf_types.h:45
Definition: hpdf_objects.h:421
HPDF_Stream stream
Definition: hpdf_objects.h:430
Definition: hpdf_doc.h:36
HPDF_MMgr mmgr
Definition: hpdf_doc.h:40
Definition: hpdf_streams.h:99