[Archivesspace_Users_Group] Customizing the Public Interface PDF
mark.custer at yale.edu
Wed Aug 30 13:51:42 EDT 2017
The new PUI PDF process does *not* use EAD or the as-ead.html.xsl file. Instead, it takes the data directly from ArchivesSpace, converts it to HTML, and then converts that HTML to PDF. For the ASpace PUI workshop I created a small plugin to illustrate how you can change the image that's added to the front page of the PDF. I haven't had a chance to provide other examples yet (or even to delve too deeply into how the new PDF creation process works), but here is where some of those files live in the ArchivesSpace core code: https://github.com/archivesspace/archivesspace/tree/master/public/app/views/pdf
If you follow the model of the "local" plugin that's already provided with ArchivesSpace, here's how you'd change the image on the front page of the PDF:
* Add a "public" directory to the local plugin, and add an "assets" subdirectory (for your new image) and a "views" subdirectory (which can be used to override the default behaviors of the PDF process).
* In the "assets" directory, add something like "images/logo.png"
* In the "view" directory, I added the following: pdf/_header.html.erb.
* In that _header.html.erb file, I kept everything the same as what's in the default file, aside from this last bit:
As long as you then have the "local" plugin turned on, you can then use this technique to change the default image as well as anything else in the PDF.
I hope that helps, and I hope to have this more fully documented soon once it's been explored a bit more. I was actually hoping to re-use the pre-exisitng XSL transformations (primarily since that's what I know!), but I believe that this approach results in PDFs much more quickly, since the EAD file also doesn't have to be generated. The other benefit, which may take a while to show its usefulness, is that you don't need to know EAD or XSLT to update the PUI PDFs. Instead, you need to know a bit about ArchivesSpace and HTML (and lots more people know about HTML than know about EAD or XSLT).
Please let us know if you're able to change the PDF using this plugin approach or not, and if you have any feedback about it. So far, all that I've done was test that I could change the logo that's used, but it would be great to develop other types of customizations so that those can be shared with the rest of the community.
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Alice Elizabeth Tippit <a-tippit at northwestern.edu>
Sent: Wednesday, August 30, 2017 11:40:41 AM
To: archivesspace_users_group at lyralists.lyrasis.org
Subject: [Archivesspace_Users_Group] Customizing the Public Interface PDF
We would like to customize the PDF that generates from the public interface, but are having difficulty figuring out which of the xsl files in the stylesheets folder is used to generate the PDF, and where to place our customized files.
When the “Print” button is clicked in our Public interface, a PDF is automatically generated. In comparison the PDF produced through the staff interface it lacks the useful table of contents and has formatting that produces a document that is twice the number of pages.
Notes from the public interface session held at the ArchivesSpace Forum indicate that we need to customize the as-ead-html.xsl file as a plugin:
>PDF from PUI is NOT generated from EAD-->PDF XSL (comes from HTML) so to customize PDF you would have to use a plugin; PDF on staff side still is from XSL<
Adding to our confusion, when we run the as-ead-html.xsl file through Oxygen the html document produced has a table of contents, and formatting that is easier on the eyes. No idea what it looks like converted into a PDF. I’d hope for something better than the PDF that currently generates on the public site.
Following the note from the public session as best we can, we attempted a test, placing a customized copy of the as-ead-html.xsl file in archivesspace > plugins > local > public > stylesheets. This had no effect.
Are we chasing the wrong file, or placing it in the wrong location? Or something else…
For interested folks, I’ve attached the html file produced by running the as-ead-html.xsl file through Oxygen, as well as the PDFs currently produced on the Public and Staff interface.
Any advice—thank you!
Developer-Metadata & Discovery Services
Northwestern University Library
1970 Campus Drive
Evanston, IL 60208
a-tippit at northwestern.edu
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Archivesspace_Users_Group