Forums / Developer / To convert pdf into some image format like jpg

To convert pdf into some image format like jpg

Author Message

Romeo Antony

Friday 01 October 2010 4:30:42 am

Hi all,

Is der any extension to convert pdf file into some jpj format.

I want to show pdf fle in some jpf format.

can anyone give a suggestion.

Romeo

Ivo Lukac

Friday 01 October 2010 4:41:52 am

If you are using linux you have the Imagemagick convert tool:

http://www.cyberciti.biz/faq/howto-convert-a-pdf-file-to-an-image/

http://www.linkedin.com/in/ivolukac
http://www.netgen.hr/eng/blog
http://twitter.com/ilukac

Romeo Antony

Friday 01 October 2010 5:48:11 am

Hi Ivo, thank you for your idea. I will try it and will let you know the progress.

Romeo

Romeo Antony

Friday 01 October 2010 6:29:02 am

Sorry to bother you again. Can you give a one more tip

I am using linux and image magic is installed.

I have uploaded some pdf files as file classes in ezp.

I would like to give a link to visitors so when they click on the link , visitors see the pdf file as an image , benifit is (pdf reader is not needed to be installed on visitors system)

Just give me a clue how to use this image magic to convert this pdf file ->image in template .

A line of code

Quoc Huy Nguyen Dinh

Friday 01 October 2010 8:10:12 am

If you have a lot of PDF files it might not be the best to start the conversion of PDF to JPEG each time.

There is an online service that allows your visitor to view PDF files without having to install a PDF reader on their computer: http://www.issuu.com/

You just sign up for an account, then copy and paste their Javascript code into your pagelayout.tpl and whenever someone click on a PDF link on your website, ISSUU will download the PDF, convert it (takes 10 minutes) and the next visitor will have a nice online PDF reader.

See my blog below, right under the Google Ads, click on "Click here for a preview of Eye Spy Intelligence Magazine number 66":

http://www.qhphotography.com/Blog/Photo-project-on-Espionage-Part-II

So the first visitor will be downloading the PDF, but 10 minutes after, everyone will get the viewer.

Romeo Antony

Saturday 02 October 2010 2:02:18 am

Thanks a million for this great idea Quoc Huy. yes you are correct it seems to be If there are lot of pdf , it is will slow down the site and when try to convert each pdf into image format.

Can you plz tell me where should I copy the javascript code in pagelayout.tpl

Romeo.

Marko Žmak

Sunday 03 October 2010 4:47:14 am

Romeo, you have also this one:

http://www.scribd.com/

I have used both scribd and issuu with eZP, and I found scribd to be a better solution for my needs. It can also convert other formats like Word, OpenOffice...

If you need help in setting it up, feel free to contact me privately via my profile.

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Romeo Antony

Sunday 03 October 2010 6:38:02 am

I will try your suggestion (scribd)Marko. Great mind. I am so thankfull for your help.

Romeo

Marko Žmak

Sunday 03 October 2010 11:54:08 am

I'm glad you found my tip usefull, here are some pointers:

  • if your documents can be freely accessed by public use scribd.Document.getDocFromUrl() it requires only the public key
  • set the height of the scribd reader to the height of the page viewport and scroll the page to the top of the reader - it improves user experience
  • setting scribd_doc.api.setFullscreen(true) in oniPaperReady() function doesn't work correctly, at least it didn't work on my site

--
Nothing is impossible. Not if you can imagine it!

Hubert Farnsworth

Quoc Huy Nguyen Dinh

Monday 04 October 2010 3:39:20 am

I've never tried scribd but issuu is working fine for the eZ and Joomla sites I've worked with. And it also handles DOC and PPT

For the script, the best is to copy/paste at the end of the pagelayout.tpl or only in the TPL that is displaying the PDF.

{literal}

[javascript_code goes here]

{/literal}

Romeo Antony

Tuesday 05 October 2010 12:07:43 am

I will try it tomorrwo and let you know how it is . thank you Quoc

eZ debug

Timing: Jan 18 2025 10:37:04
Script start
Timing: Jan 18 2025 10:37:04
Module start 'content'
Timing: Jan 18 2025 10:37:06
Module end 'content'
Timing: Jan 18 2025 10:37:06
Script end

Main resources:

Total runtime2.2349 sec
Peak memory usage4,096.0000 KB
Database Queries223

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0122 588.9609180.8203
Module start 'content' 0.01222.0513 769.7813736.0313
Module end 'content' 2.06350.1713 1,505.8125344.4297
Script end 2.2348  1,850.2422 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00500.2257210.0002
Check MTime0.00170.0769210.0001
Mysql Total
Database connection0.00140.063510.0014
Mysqli_queries2.099493.93712230.0094
Looping result0.00270.11952210.0000
Template Total2.161196.721.0806
Template load0.00270.121620.0014
Template processing2.158496.576421.0792
Template load and register function0.00010.004610.0001
states
state_id_array0.00350.156610.0035
state_identifier_array0.00260.116020.0013
Override
Cache load0.00240.1077660.0000
Sytem overhead
Fetch class attribute can translate value0.00200.087450.0004
Fetch class attribute name0.00170.0746150.0001
XML
Image XML parsing0.00380.172050.0008
class_abstraction
Instantiating content class attribute0.00000.0018220.0000
General
dbfile0.00590.2654500.0001
String conversion0.00000.000330.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
11content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
11content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1content/datatype/view/ezxmltags/link.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/link.tplEdit templateOverride template
1content/datatype/view/ezxmltags/li.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/li.tplEdit templateOverride template
1content/datatype/view/ezxmltags/ul.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/ul.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 39
 Number of unique templates used: 8

Time used to render debug report: 0.0002 secs