pkMediaPlugin won't work well (or not at all) with PDFs

1 view
Skip to first unread message

virtualize

unread,
Dec 16, 2009, 1:10:55 PM12/16/09
to pkcontextcms
Hi there

I'm using the pkMediaPlugin in conjunction with the cmstest sandbox.

Uploading pdfs works as far as I can tell, but no pdf is found in /web/
uploads/media_items. I found the pdf in /data/pk_writable/
persistent_uploads/[hash].file

When I select a pdf in media library for preview, I get a 500 and
symfony saying "The "/uploads/
media_items/:slug.:width.:height.:resizeType.:format" route has some
missing mandatory parameters (:width, :format)."

And after selecting pdf from inside a pkContextCMSPDF slot there is
only "Warning: Division by zero in /Users/virtualize/Sites/vps/plugins/
pkToolkitPlugin/lib/pkDimensions.class.php on line 19" displayed,
instead of the pdf link.

No problems on working with images, so I guess the pdf seems to be
mistreated as image?

Here's my slot setup:
<?php pk_context_cms_area('body', array(
'allowed_types' => array('pkContextCMSRichText', 'pkContextCMSPDF',
'pkContextCMSImage'),
'type_options' => array(
'pkContextCMSRichText' => array('tool' => 'Main'),
'pkContextCMSPDF' => array('width' => 200, 'flexHeight' => true,
'resizeType' => 's'),
'pkContextCMSImage' => array('width' => 200, 'flexHeight' => true,
'resizeType' => 's'),
))) ?>

I would also be very thankful if one could explain these type_options
to me.

Thanks in advance.
Chris

Tom Boutell

unread,
Dec 16, 2009, 1:18:28 PM12/16/09
to pkcont...@googlegroups.com
You need to install the ghostscript package for your OS for PDF slots
to work. See this excerpt from the manual:

"See pkMediaPlugin/README and pkImageConverterPlugin/README for more
information about installing netpbm and ghostscript. A few truly
excellent hosting
companies may already have these in place. If you have a Virtual
Private Server
(and you should, shared hosting is very insecure), you can most likely install
netpbm and ghostscript with a few simple commands like `sudo apt-get
install netpbm`
and `sudo apt-get install ghotscript`."

We do plan to allow a fallback mode in which PDF slots just display a
PDF icon instead of an actual snapshot of the PDF in the future, but
install ghostscript and get the real thing!
> --
>
> You received this message because you are subscribed to the Google Groups "pkcontextcms" group.
> To post to this group, send email to pkcont...@googlegroups.com.
> To unsubscribe from this group, send email to pkcontextcms...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/pkcontextcms?hl=en.
>
>
>



--
Tom Boutell
P'unk Avenue
215 755 1330
punkave.com
window.punkave.com
Reply all
Reply to author
Forward
0 new messages