Skip to content
This repository has been archived by the owner on Sep 22, 2022. It is now read-only.

JPEG create issue #2

Open
Ibrahimwatfa opened this issue Nov 9, 2015 · 9 comments
Open

JPEG create issue #2

Ibrahimwatfa opened this issue Nov 9, 2015 · 9 comments

Comments

@Ibrahimwatfa
Copy link

Dear Support,

I'm having trouble creating the pages as JPEG, it will only work once i remove the below code :
case 'imageJpeg':
$result = '-fmt ' . ($value ? 'jpg' : 'png');
break;

if the above code is enabled the browser goes infinite loop.
The latest Poppler is installed on our server.

@Ibrahimwatfa Ibrahimwatfa changed the title JPEAG create issue JPEG create issue Nov 9, 2015
@tonchik-tm
Copy link
Owner

What happens, when you run the following command?
pdftohtml -fmt jpg your_pdf_file.pdf

@Ibrahimwatfa
Copy link
Author

Thanks for your quick response.

When i use '-fmt jpg' or '-fmt png' the browser goes loading and loading in an infinite loop, once i remove it the pdf is converted but it takes much time because the images are created as PNG.

@tonchik-tm
Copy link
Owner

You need to execute command in console:
pdftohtml -fmt jpg your_pdf_file.pdf

and analyse result

@Ibrahimwatfa
Copy link
Author

Well i don't have access to the command console on the online server.
But locally I'm using the poppler for windows and all is working fine.

Is there any relevant command for '-fmt jpg' that i can use?

@Ibrahimwatfa
Copy link
Author

If i print the result of the command when using exec() i get the below:
-nodrm : override document DRM settings

And when using shell_exec() i get the below:

pdftohtml version 0.12.4 
Copyright 2005-2009 The Poppler Developers - http://poppler.freedesktop.org 
Copyright 1999-2003 Gueorgui Ovtcharov and Rainer Dorsch 
Copyright 1996-2004 Glyph & Cog, LLC 

Usage: pdftohtml [options] [ ] 
    -f : first page to convert 
    -l : last page to convert 
    -q : don't print any messages or errors 
    -h : print usage information 
    -help : print usage information 
    -p : exchange .pdf links by .html 
    -c : generate complex document 
    -i : ignore images 
    -noframes : generate no frames -stdout : use standard output 
    -zoom : zoom the pdf document (default 1.5) 
    -xml : output for XML post-processing 
    -hidden : output hidden text 
    -nomerge : do not merge paragraphs 
    -enc : output text encoding name 
    -dev : output device name for Ghostscript (png16m, jpeg etc) 
    -v : print copyright and version info 
    -opw : owner password (for encrypted files) 
    -upw : user password (for encrypted files) 
    -nodrm : override document DRM settings 

i cant see any '-fmt' command available in the output, am i right?

@tonchik-tm
Copy link
Owner

I think your poppler version too old.
Support JPG begins from poppler-0.13.0 (Mon Jan 25, 2010)

pdftohtml version 0.18.4
Copyright 2005-2011 The Poppler Developers - http://poppler.freedesktop.org
Copyright 1999-2003 Gueorgui Ovtcharov and Rainer Dorsch
Copyright 1996-2004 Glyph & Cog, LLC

Usage: pdftohtml [options] <PDF-file> [<html-file> <xml-file>]
  -f <int>          : first page to convert
  -l <int>          : last page to convert
  -q                : don't print any messages or errors
  -h                : print usage information
  -help             : print usage information
  -p                : exchange .pdf links by .html
  -c                : generate complex document
  -s                : generate single document that includes all pages
  -i                : ignore images
  -noframes         : generate no frames
  -stdout           : use standard output
  -zoom <fp>        : zoom the pdf document (default 1.5)
  -xml              : output for XML post-processing
  -hidden           : output hidden text
  -nomerge          : do not merge paragraphs
  -enc <string>     : output text encoding name
  -dev <string>     : output device name for Ghostscript (png16m, jpeg etc)
  -fmt <string>     : image file format for Splash output (png or jpg)
  -v                : print copyright and version info
  -opw <string>     : owner password (for encrypted files)
  -upw <string>     : user password (for encrypted files)
  -nodrm            : override document DRM settings

@Ibrahimwatfa
Copy link
Author

Well that's make sense.
How we can update it to the latest version, is there any SSH command or link to do it.

Thanks a lot for your help.

@tonchik-tm
Copy link
Owner

If you don't have root access on server, then you can try to find tool for your OS.
http://poppler.freedesktop.org
I doubt that you can bild from utility sources without root access

@Ibrahimwatfa
Copy link
Author

Well i can contact the owners of the server.
So if there's a direct SSH command for the latest Poppler, that will be very helpful.

Thanks is advance.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants