Richard Jedlička Posted October 2, 2017 Author Share Posted October 2, 2017 @ICF Church Please go to the page /admin/module/edit?name=FieldtypePDF a post here the exact version of FieldtypePDF you have, thanks Link to comment Share on other sites More sharing options...
ICF Church Posted October 2, 2017 Share Posted October 2, 2017 It's 1.1.4 and it happenes when I create a new field of the type… Link to comment Share on other sites More sharing options...
Richard Jedlička Posted October 7, 2017 Author Share Posted October 7, 2017 @ICF Church Hi, I'm trying to solve your issue, but I can't reproduce the error. What version of PHP are you using? During module installation there is a step where the `use` statemenents in source files under FieldtypePDF folder are prefixed with `Processwire\' namespace if PW 3.x detected. Could you please examine what's wrong? Look into this method https://github.com/uiii/ProcessWire-FieldtypePDF/blob/d11ff962d520782fa25215f5ce606886773a5a44/FieldtypePDF.module#L232. Thanks Link to comment Share on other sites More sharing options...
Richard Jedlička Posted October 7, 2017 Author Share Posted October 7, 2017 @ICF Church One more question. Did you installed it as a new module, or updated the older version? Link to comment Share on other sites More sharing options...
Richard Jedlička Posted April 5, 2018 Author Share Posted April 5, 2018 @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. 1 Link to comment Share on other sites More sharing options...
ICF Church Posted April 9, 2018 Share Posted April 9, 2018 Thank you Link to comment Share on other sites More sharing options...
ThomasH Posted January 4, 2019 Share Posted January 4, 2019 (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 January 4, 2019 by ThomasH Link to comment Share on other sites More sharing options...
itsberni Posted January 13, 2019 Share Posted January 13, 2019 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: ImageMagick 6.9.4-6 Q16 i686 2016-06-03Do you know anything about this? Thanks! Link to comment Share on other sites More sharing options...
Richard Jedlička Posted January 13, 2019 Author Share Posted January 13, 2019 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 Link to comment Share on other sites More sharing options...
adrian Posted January 13, 2019 Share Posted January 13, 2019 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. Link to comment Share on other sites More sharing options...
itsberni Posted January 13, 2019 Share Posted January 13, 2019 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.... Link to comment Share on other sites More sharing options...
adrian Posted January 13, 2019 Share Posted January 13, 2019 Sorry @itsberni - I totally misread the error message - obviously not a file permission issue for those modules - sorry for the wild goose chase. Link to comment Share on other sites More sharing options...
itsberni Posted January 15, 2019 Share Posted January 15, 2019 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!! Link to comment Share on other sites More sharing options...
netcarver Posted March 31, 2019 Share Posted March 31, 2019 @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" /> 2 Link to comment Share on other sites More sharing options...
Miloslav Posted August 25, 2019 Share Posted August 25, 2019 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) 1 Link to comment Share on other sites More sharing options...
snck Posted September 30, 2019 Share Posted September 30, 2019 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 Link to comment Share on other sites More sharing options...
wbmnfktr Posted September 30, 2019 Share Posted September 30, 2019 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 ß. Link to comment Share on other sites More sharing options...
snck Posted September 30, 2019 Share Posted September 30, 2019 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. Link to comment Share on other sites More sharing options...
wbmnfktr Posted September 30, 2019 Share Posted September 30, 2019 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. 1 Link to comment Share on other sites More sharing options...
snck Posted September 30, 2019 Share Posted September 30, 2019 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 ? Link to comment Share on other sites More sharing options...
erikvanberkum Posted January 9, 2020 Share Posted January 9, 2020 After upgrading to the latest master 3.0.148 coming from the 3.0.123 version, this module stopped working in the sense that i am no longer able to upload files. I get the following error message: NOT AUTHORISED /files/assets/8888/filename.pdf @ error/constitute.c/ReadImage/412 Link to comment Share on other sites More sharing options...
erikvanberkum Posted February 26, 2020 Share Posted February 26, 2020 I am still having issues with this module. this is what the error log shows running 3.0.148: Fatal Error: Uncaught TypeError: Argument 1 passed to InputfieldPDF::getAdminThumb() must be an instance of FieldtypePDF\PagePDF, instance of Pagefile given, called in /site/assets/cache/FileCompiler/site/modules/FieldtypePDF/InputfieldPDF.module on line 111 and defined in /site/assets/cache/FileCompiler/site/modules/FieldtypePDF/InputfieldPDF.module:57 Stack trace: 1. /site/assets/cache/FileCompiler/site/modules/FieldtypePDF/InputfieldPDF.module(111): InputfieldPDF->getAdminThumb(Object(Pagefile)) 2. /wire/core/Wire.php(389): InputfieldPDF->___renderItem(Object(Pagefile), 'pdf_manual_6feb...', 0) 3. /wire/core/WireHooks.php(823): Wire->_callMethod('___renderItem', Array) 4. /wire/core/Wire.php(450): WireHooks->runHooks(Object(InputfieldPDF), 'renderItem', Array) 5. /wire/modules/Inputfield/InputfieldFile/InputfieldFile.module(562): Wire->__ Line 57 of /site/assets/cache/FileCompiler/site/modules/FieldtypePDF/InputfieldPDF.module Anyone experience or suggestions how to get around this? Link to comment Share on other sites More sharing options...
Richard Jedlička Posted February 26, 2020 Author Share Posted February 26, 2020 Hi @erikvanberkum, I apologize but I don't have time to investigate it, are you able to find out what's wrong? Link to comment Share on other sites More sharing options...
erikvanberkum Posted March 7, 2020 Share Posted March 7, 2020 hello @Richard Jedlička, i found the issue. It was not an issue with the module but a problem with an ImageMagick-6 policy update on my Ubuntu machine, which seems to have happen around the same time as i updated my Processwire version: The solution to my problem was to edit /etc/ImageMagick-6/policy.xml than change the following line from: <policy domain="coder" rights="none" pattern="PDF" /> to <policy domain="coder" rights="read|write" pattern="PDF" /> and added the following line <policy domain="coder" rights="read|write" pattern="LABEL" /> By changing the policy you have to make sure that you can trust the users that upload the pdf files. 1 1 Link to comment Share on other sites More sharing options...
digitex Posted July 30, 2020 Share Posted July 30, 2020 Does fieldType PDF support tags? You can configure tags in the field set up but I get an error when I check for them with $pdf->getTag(). Edit: The field is fine, I made a mistake in how I was retrieving the tags, forgot that in order to get the tags as an array it should be $pdf->tags(true); and so the way I was doing it was the problem. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now