erikvanberkum Posted July 24, 2021 Share Posted July 24, 2021 Similar problem here: Fatal Error: Uncaught Error: Class 'Pagefiles' not found in site/modules/FieldtypePDF/FieldtypePDF/PagePDFs.php:37 Using PW ProcessWire 3.0.165 Link to comment Share on other sites More sharing options...
teppo Posted July 24, 2021 Share Posted July 24, 2021 @erikvanberkum, I've merged your question from general support to the support thread of the FieldtypePDF module. You may also want to open an issue about this in the FieldtypePDF GitHub repository. Also, please make sure that you're running the latest version of the module ? Link to comment Share on other sites More sharing options...
kalimati Posted October 2, 2024 Share Posted October 2, 2024 It seems like I have a colour depth issue when trying to generate an image from an uploaded PDF file. Any clues how this can be corrected? Thanks. Link to comment Share on other sites More sharing options...
Richard Jedlička Posted October 3, 2024 Author Share Posted October 3, 2024 Hi @kalimati, not exactly sure, but I guess it will be related to the colorspace the PDF is in? 🤔 I am no expert on this area and don't know if PDF can have different colorspace, but the field has an option to set the colorspace to be used for the image generating (on Details tab), so you can experiment with it. You can also check https://github.com/uiii/ProcessWire-FieldtypePDF/blob/9f07314883cd281e09851f149b8889c1a3e8daa0/FieldtypePDF/PDFConverter.php#L149 where is the code to generate the image, and you can find a way how to use ImageMagick to generate image for your PDF, we may reflect it in the code after. Link to comment Share on other sites More sharing options...
Richard Jedlička Posted October 3, 2024 Author Share Posted October 3, 2024 @kalimati Also this looks useful https://imagemagick.org/discourse-server/viewtopic.php?p=80210&sid=88e589266091f18cef53b8adc6a4d0b1#p80210 Try to identify the colorspace, this way it would be useful to detect the colorspace in the code if possible. Link to comment Share on other sites More sharing options...
kalimati Posted October 3, 2024 Share Posted October 3, 2024 1 hour ago, Richard Jedlička said: Hi @kalimati, not exactly sure, but I guess it will be related to the colorspace the PDF is in? 🤔 I am no expert on this area and don't know if PDF can have different colorspace, but the field has an option to set the colorspace to be used for the image generating (on Details tab), so you can experiment with it. You can also check https://github.com/uiii/ProcessWire-FieldtypePDF/blob/9f07314883cd281e09851f149b8889c1a3e8daa0/FieldtypePDF/PDFConverter.php#L149 where is the code to generate the image, and you can find a way how to use ImageMagick to generate image for your PDF, we may reflect it in the code after. Thanks for your reply, Richard. I don't see the ImageMagick settings (advanced) in my installation. I am using Processwire 3.0.229 and module version 1.1.5 on Ubuntu with PHP 8.1. Link to comment Share on other sites More sharing options...
Richard Jedlička Posted October 3, 2024 Author Share Posted October 3, 2024 1 minute ago, kalimati said: I don't see the ImageMagick settings (advanced) in my installation. It is in the field settings (Details tab) not the module settings. Link to comment Share on other sites More sharing options...
kalimati Posted October 3, 2024 Share Posted October 3, 2024 6 hours ago, Richard Jedlička said: It is in the field settings (Details tab) not the module settings. I can't see it in my setup. Please see the attached screenshot. Link to comment Share on other sites More sharing options...
Richard Jedlička Posted October 3, 2024 Author Share Posted October 3, 2024 I see, you have the old version. Update to the latest one (2.0.0). 2 Link to comment Share on other sites More sharing options...
kalimati Posted October 4, 2024 Share Posted October 4, 2024 I had to use composer to install it. The module folder created is different from the earlier one. Worked as expected. Thanks. 1 Link to comment Share on other sites More sharing options...
Richard Jedlička Posted October 4, 2024 Author Share Posted October 4, 2024 @kalimati It means it was fixed by the new version so you didn't have to deal with the colorspace? Link to comment Share on other sites More sharing options...
kalimati Posted October 4, 2024 Share Posted October 4, 2024 That's right, default settings were enough. Link to comment Share on other sites More sharing options...
Sten Posted March 28 Share Posted March 28 On 7/24/2021 at 8:27 AM, erikvanberkum said: Similar problem here: Fatal Error: Uncaught Error: Class 'Pagefiles' not found in site/modules/FieldtypePDF/FieldtypePDF/PagePDFs.php:37 Using PW ProcessWire 3.0.165 Similar problem here: Fatal Error: Uncaught Error: Class 'Pagefiles' not found in site/modules/FieldtypePDF/FieldtypePDF/PagePDFs.php:37 ProcessWire 3.0.244 Link to comment Share on other sites More sharing options...
Richard Jedlička Posted March 28 Author Share Posted March 28 49 minutes ago, Sten said: Similar problem here: Fatal Error: Uncaught Error: Class 'Pagefiles' not found in site/modules/FieldtypePDF/FieldtypePDF/PagePDFs.php:37 ProcessWire 3.0.244 Hi @Sten, can you please share what PHP and FieldtypePDF version do you use? Link to comment Share on other sites More sharing options...
Sten Posted March 28 Share Posted March 28 Thank you Richard. I have the last version of FieldtypePDF with PHP8.3. I was able to correct this problem as I deleted the data in the FieldtypePDF row in the modules table in Mariadb. {"-dups":["\/site\/modules\/ProcesswireFieldtypepdf\/FieldtypePDF.module.php","\/site\/modules\/ProcessWire-FieldtypePDF\/FieldtypePDF.module.php","\/site\/modules\/FieldtypePDF\/FieldtypePDF.module"],"-dups-use":"\/site\/modules\/FieldtypePDF\/FieldtypePDF.module"} 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