Jump to content

Recommended Posts

@ICF Church Hi, I've released new version which should fix your problem, I know it is a little bit late but if you are still interested, you may try it.

I didn't face the error before but now, there are some misterious ways to me how PW detect module updates and sometimes detect the updated module as a new module so the `upgrade` method is not executed and the namespaces are not fixed which leads to the error mentioned by you. So I've moved the 'namespaces fix' code to the init method so it will check if the namespaces are fixed each time the module is initialized.

It may happed that you will see the 'Fieldtype 'FieldtypePDF' does not exist' when updating the module, just hit the refresh button again and you are fine.

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Hi, i use PW 3.0.123 and can't use your module

 Class 'Pagefile' not found (Zeile 39 in /kunden/310636_12107/webseiten/meab/dev/site/modules/FieldtypePDF/FieldtypePDF/PagePDF.php) 

PDF with thumbnail

FieldtypePDF

1.1.5

i install from github cause the php-files (in subfolder FieldtypePDF) were empty after regularly module installation from pw repository 

 

Edited by ThomasH

Share this post


Link to post
Share on other sites

Hi @Richard Jedlička

thanks a lot for this useful modul!!
Unfortunately i am running into following issue.
When trying to upload a PDF i get this error and the upload fails.
 

Failed to read the file (in /wire/modules/Inputfield/InputfieldFile/InputfieldFile.module line 790)


I´m using PW 3.0.95 - and the FieldtypePDF 1.1.5.
PHP Version: 7.2.4
ImageMagick: I
mageMagick 6.9.4-6 Q16 i686 2016-06-03

Do you know anything about this?

Thanks!

 

Share this post


Link to post
Share on other sites

Hi guys,
I'm sorry to hear you have the issues. Unfortunatelly I don't have enough time to look at it now, I hope I'll find some in a few weeks. If you can examine it by yourself, you are welcome to send a PR. 

Cheers, Richard

Share this post


Link to post
Share on other sites
5 hours ago, itsberni said:

Failed to read the file (in /wire/modules/Inputfield/InputfieldFile/InputfieldFile.module line 790)

How did you install the module? If you copied the files manually I am guessing this is simply a file permissions issue - make sure everything has the correct owner and permissions that allow reading of the files. 

Share this post


Link to post
Share on other sites

Hy adrian,

i installed the module over the pw-backend as Admin.

it‘s all curios, because in my dev-enviroment with pw 3.0.123 and php7.0 it works.

The difference between both cases is the Server-enviroment....

Share this post


Link to post
Share on other sites

Sorry @itsberni - I totally misread the error message - obviously not a file permission issue for those modules - sorry for the wild goose chase.

 

Share this post


Link to post
Share on other sites

Hi all,

tried several things.....changed the php-version on the Server (down to 7.0). Updating pw to the latest master (123). Uninstalling and installing the module again.

the result is the same.

could there be any problem with the server (mittwald) to handle pdf-files in terms of security?

any thoughts or suggestions?

 

SOLUTION:

The PHP-Version has to be 7.0.32 CGI - now it works!!

Share this post


Link to post
Share on other sites

@itsberni

I just ran into this on my development server (using PHP7.2)

The clues to a fix were found here.  NB, this module doesn't need ImageMagick/Ghostscript to have write permissions for PDFs to generate the thumbnails, read permission worked just fine for me.

  <policy domain="coder" rights="read" pattern="PDF" />

 

  • Like 2

Share this post


Link to post
Share on other sites
On 1/4/2019 at 2:37 PM, ThomasH said:

Hi, i use PW 3.0.123 and can't use your module

 Class 'Pagefile' not found (Zeile 39 in /kunden/310636_12107/webseiten/meab/dev/site/modules/FieldtypePDF/FieldtypePDF/PagePDF.php) 

   

Hi @ThomasH

In file PagePDF.php on lines 32,33,34 change to:

use ProcessWire\Pagefile;
use ProcessWire\Pageimage;
use ProcessWire\Pageimages;

and in file PagePDFs.php add ProcessWire\ namespace for Pagefiles as well (on line 29)

BTW @Richard Jedlička very useful module for me now 🙂 Thanks a lot!

Working on PW 3.0.133, PHP 7.3.8 FPM (FieldtypePDF v. 1.1.5)

Share this post


Link to post
Share on other sites

First of all many thanks to @Richard Jedlička for this great module. It does exactly what I was looking for, unfortunately I have a problem with the generated thumbnails: German umlauts are simply not displayed. In the ImageMagick documentation I can't find any hint and can only assume that it is somehow related to Ghostscript?

Maybe someone of you already had the same problem found and a solution?

Many thanks in advance!

Cheers,
Florian

Share this post


Link to post
Share on other sites
35 minutes ago, snck said:

generated thumbnails: German umlauts are simply not displayed

No umlauts in the cover/screenshot of your uploaded PDF?
Do you use some special fonts in the PDF which are not embedded?

I got the module working somehow and threw a ton of PDFs at it and there were lots of ä,ö,ü and ß.

Share this post


Link to post
Share on other sites
18 minutes ago, wbmnfktr said:

No umlauts in the cover/screenshot of your uploaded PDF?
Do you use some special fonts in the PDF which are not embedded?

Yes, I get no umlauts in the generated image. The only font used is AvenirLT-Medium, which is embedded correctly (at least Adobe Acrobat tells me it is). The PDF hat been generated with Adobe Indesign. Left of the attached image is the output I get from the module, on the right site the PDF in Acrobat as reference.

Bildschirmfoto 2019-09-30 um 15.53.30.png

Share this post


Link to post
Share on other sites

Just queried Google and there might be a problem with either

  • ImageMagick
  • Ghostscript
  • Missing fonts
  • Wrong/false/incomplete embedded fonts
  • Other font issues

Or in short... if it's a server-related you might have to dig quite deep into it. From ImageMagick versions to installed Ghostscript fonts to (above mentioned) policy restrictions. Depending on your hosting or the client's hosting it might not even work. Shared hosting plans don't allow access to files and folders - but in most cases those environments are pretty well configured.

It might be easier to create a already pre-rendered first page for the PDF without any real text and fonts. Maybe converting them to paths or however it works in InDesign.

As it is only a download and nothing you'd push to a print shop, it should work out just fine.

  • Like 1

Share this post


Link to post
Share on other sites

Thanks for your quick reply! My problem is that the client generates the PDF himself, it contains a lot of pages and gets updated regularly. Our goal is to streamline his workflow by offering him to upload just one file and having the website generate thumbnails for all pages with hi-res previews as well. I will play around with Indesign's PDF export options and try wo solve the problem by converting the fonts to paths, but we do not want to loose the ability to search in the PDF. I will try to test it on the client's server as soon as possible, maybe the configuration there magically solves my problem 😉

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By eelkenet
      Hi! I've created a small Inputfield module called InputfieldFloatRange which allows you to use an HTML5 <input type="range" ../> slider as an InputField. I needed something like this for a project where the client needs to be able to tweak this value more based on 'a feeling' than just entering a boring old number. Maybe more people can use this so I'm hereby releasing it into the wild.  
       
      What is it?
      The missing range slider Inputfield for Processwire. 
      What does it do?
      This module extends InputfieldFloat and allows you to use HTML5 range sliders for number fields in your templates.
      It includes a visible and editable value field, to override/tweak the value if required.  
      Features
      Min/max values Precision (number of decimals) Steps (Read more) Manual override of the selected value (will still adhere to the rules above) Usage
      Clone / zip repo Install FieldtypeFloatRange, this automatically installs the Inputfield Create new field of type `Float (range)` or convert an existing `Float`, `Integer` or `Text` field. To render the field's value simply echo `$page->field` Demo
      A field with Min=0, Max=1, Step=0.2, Precision=2

      Field with settings Min=0, Max=200, Step=0.25, Precision=2

       
      Todo
      Make the display-field's size configurable (will use the Input Size field setting)  Hopefully become redundant If it's usable for others I'll add it to the Modules list  
      Changelog
      v002
      - Fix issue where setting the step value to an empty value created problem with validation
      - Make the display-field optional 
      v001
      - Initial release
       
      Thanks!
       
       
    • By August
      Hi again, after trying pages2PDF, RockPDF and mpdf I'm not sure which of them I should use. Of course, there is also wirePDF.
      I merged mpdf with rockPDF, add a footer and a page in Landscape and that works, like in the code-snippet below but be am I on the right way?
      After that I tried a couple of times rendering an image. Nothing happend, the same with Pages2PDF too. I also copied an Image-URL within processwire and tried further getting an Image within the PDF-Document, but it still display only the red marked placeholder.
      I simply would like create an PDF on click from some Pages including the Images.
      Are there special requirements on Debian 10 with Apache and php 7.3 using Processwire 3.0.123.?
      Is there a guide that I didn't found?
      Is somebody out there who has a similar issue solved and would you be so kind to explain?
       
      $pdf = $modules->get('RockPdf'); $mpdf = $pdf->mpdf; # $mpdf->showImageErrors = true; $pdf->set('SetHeader', 'header text'); $mpdf->AddPage('L'); # $mpdf->Image(urlencode('site/assets/files/1845/image-2.275x200.jpg'), 0, 0, 210, 297, 'jpg', '', true, false); $pdf->set('SetFooter', ' <table width="100%"> <tr> <td width="33%">{DATE j.m.Y}</td>        <td width="33%" align="center">{PAGENO}/{nbpg}</td> <td width="33%" style="text-align: right;">whatever</td> </tr> </table>'); $pdf->show(); // generate pdf  
    • By Robin S
      Another little admin helper module...
      Template Field Widths
      Adds a "Field widths" field to Edit Template that allows you to quickly set the widths of inputfields in the template.

      Why?
      When setting up a new template or trying out different field layouts I find it a bit slow and tedious to have to open each field individually in a modal just to set the width. This module speeds up the process.
      Installation
      Install the Template Field Widths module.
      Config options
      You can set the default presentation of the "Field widths" field to collapsed or open. Field widths entered into the Template Field Widths inputfield are only applied if the Edit Template form is submitted with the Template Field Widths inputfield in an opened state. "Collapsed" is the recommended setting if you think you might also use core inputs for setting field widths in a template context. You can choose Name or Label as the primary identifier shown for the field. The unchosen alternative will become the title attribute shown on hover. You can choose to show the original field width next to the template context field width.  
      https://github.com/Toutouwai/TemplateFieldWidths
      https://modules.processwire.com/modules/template-field-widths/
    • By adrian
      Tracy Debugger for ProcessWire
      The ultimate “swiss army knife” debugging and development tool for the ProcessWire CMF/CMS

       
      Integrates and extends Nette's Tracy debugging tool and adds 35+ custom tools designed for effective ProcessWire debugging and lightning fast development
      The most comprehensive set of instructions and examples is available at: https://adrianbj.github.io/TracyDebugger
      Modules Directory: http://modules.processwire.com/modules/tracy-debugger/
      Github: https://github.com/adrianbj/TracyDebugger
      A big thanks to @tpr for introducing me to Tracy and for the idea for this module and for significant feedback, testing, and feature suggestions.
×
×
  • Create New...