Adding watermark to pdfs

54 views
Skip to first unread message

Carolyn Sullivan

unread,
Aug 9, 2023, 4:35:00 PM8/9/23
to AtoM Users
Hello all,

I've successfully applied watermarks to the images in our institutional repository here (https://biblio.uottawa.ca/atom/), but I can't figure out how to apply watermarks to our pdfs.  The documentation for watermarking seems to suggest it should be applied to pdfs as well: https://www.accesstomemory.org/en/docs/2.7/admin-manual/customization/watermarking/

Any suggestions?

Thanks,
Carolyn.

Dan Gillean

unread,
Aug 10, 2023, 8:29:47 AM8/10/23
to ica-ato...@googlegroups.com
Hi Carolyn, 

I just want to quote the whole mention of PDFs from that page in the documentation in context: 

AtoM supports basic digital watermarking functionality for images and text files such as PDFs, since the preview image (aka the reference display copy) for a text file is a JPG image. The watermark does not alter or affect the master digital object. Similarly, thumbnail images, used in search and browse results, are also unaffected. Only the reference display copy, used on the view page of an archival description, will show the watermark.

So to be clear: the watermark SHOULD affect the preview of the first page of the PDF (or if you have changed what page is used for the preview via the settings, then that page) that is shown on the related archival description. It will NOT affect the thumbnail, nor will it actually overlay a watermark on the PDF itself, which in this case is the master digital object (i.e. the original). 

AtoM never alters the originals when applying watermarks - only the display copy shown on view pages.  

In glancing at your site, I noticed that many of your digital objects (or at least, almost all of the PDFs, as well as all the videos) are lacking derivatives. Is this by choice, or an unexpected outcome? If the latter, then you might want to try regenerating your derivatives. See: 
Hopefully this will resolve all issues at once! 

Let us know how it goes, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him


--
You received this message because you are subscribed to the Google Groups "AtoM Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ica-atom-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/ica-atom-users/fe6c057c-d0ee-4fcd-b2cc-6e2dc2a9076fn%40googlegroups.com.

Lrellis D'erth

unread,
Aug 14, 2023, 5:04:55 PM8/14/23
to ica-ato...@googlegroups.com
Hello Dan,

Thank you for the clarification on watermarking pdfs, and for noticing that the derivatives weren't being produced for the videos or pdfs.  
RegenDerivatives_Pdfsecurityerror_081123.PNG

On examination, the lack of derivatives for pdfs was an issue with the default security settings for ImageMagick being configured not to allow processing of pdfs due to some security gap with older versions of ghostscript: https://stackoverflow.com/questions/52998331/imagemagick-security-policy-pdf-blocking-conversion

I enabled processing of pdfs according to the suggestions on stackoverflow (ONLY pdfs, since I'm not sure what risks I'd be introducing with other file types on an open web server), so now those seem to be processing without an error, BUT they're still not appearing.  I'm also encountering an additional weird error where when I try to regenerate derivatives with the option media-type='videos', it still regenerates ALL the derivatives... and then keeps timing out.  
RegenDerivatives_MediaTypeIssue_081423.PNG
I'm using the skip-to, but it's still very tedious doublechecking the job every 15 minutes to see if it got killed again.  Suggestions?

Thank you for your time and help,
Carolyn.


Dan Gillean

unread,
Aug 16, 2023, 9:52:28 AM8/16/23
to ica-ato...@googlegroups.com
Hi again Carolyn, 

Huh, I had thought that the ImageMagick PDF policy issue had been resolved upstream, but it sounds like maybe not... it sounds like you may have found the same workaround, but we've previously done the following with success to address this: 
What version of AtoM do you have installed? I can see some digital object fixes and enhancements in 2.7.0, but nothing that seems directly related to these specific reports. However, there's an important change in release 2.6.3 - we replaced the older Flash-based digital object viewer with a new HTML5-based one, since Flash support has now been removed from most browsers. Are you at minimum running release 2.6.3 or later?

Additionally, how much memory is allocated to your installation? Does it meet or exceed the recommended hardware requirements described here
  • Processor: 2 vCPUs @ 2.3GHz
  • Memory: 7GB
  • Disk space (processing): 50GB at a minimum for AtoM’s core stack plus more storage would be required for supporting any substantial number of digital objects.

Alternatively, have you tried...
I don't know if these things will help, but they might? Note that there is also the max_execution_time value that can be configured in your PHP pool, which might help with timeouts. 

As for the media-type option issue.... unfortunately I have managed to reproduce this locally in my test environment. As such, I suspect that you've found a regression. I have filed a bug report here: 
Hopefully our Maintainers will be able to take a look for the next release! 

Cheers, 

Dan Gillean, MAS, MLIS
AtoM Program Manager
Artefactual Systems, Inc.
604-527-2056
@accesstomemory
he / him

Reply all
Reply to author
Forward
0 new messages