pdf2htmlEX
pdf2htmlEX copied to clipboard
Need PDF to HTML with all images
Hi Team
Your package is awesome. I need some help in that. I have converted PDF to HTML from your package. But it will not return all images that we have in PDF separately, I want to know How can I have all images.
For e.g., I have a PDF with 3 images and I need html should have 3 images in that separately, so that I can reuse or replace those images in HTMl and later on I m converting that HTML to Image.
Please help.
Thank you in advance.
`` #if 1 if(maskColors) return;
const char * filename = str_fmt("%s/f%llx%s", param.dest_dir.c_str(), image_count++, ".jpg");
FILE * f = fopen(filename, "wb");
if(!f)
throw string("Cannot open file for background image " ) + filename;
std::unique_ptr<ImgWriter> writer;
writer = std::unique_ptr<ImgWriter>(new JpegWriter);
if(!writer->init(f, width, height, param.h_dpi, param.v_dpi))
throw "Cannot initialize image writer";
ImageStream * img_stream = new ImageStream(str, width, colorMap->getNumPixelComps(), colorMap->getBits());
img_stream->reset();
for(int i = 0; i < height; ++i)
{
auto p = img_stream->getLine();
writer->writeRow(&p);
}
if(!writer->close())
{
throw "Cannot finish background image";
}
fclose(f);
#endif
put this in image.cc