[Archivesspace_Users_Group] Customizing the Public Interface PDF

Custer, Mark mark.custer at yale.edu
Wed Aug 30 14:59:57 EDT 2017

Steve, that's excellent.  In fact, that should probably just get added to the core code, I'd think! 😊

From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Majewski, Steven Dennis (sdm7g) <sdm7g at virginia.edu>
Sent: Wednesday, August 30, 2017 2:17:39 PM
To: Archivesspace Users Group
Subject: Re: [Archivesspace_Users_Group] Customizing the Public Interface PDF

Thanks, Mark.

I gave this a try and verified that it worked added to plugins/local/public/views/pdf/_header.html.erb

We have different logos for different repositories.

If you add the logos to the repository branding image url, this pulls that image url:

<div class="logo"><%= image_tag( record.resolved_repository['image_url'] || asset_url("Aspace-logo.png") ) %></div>

-- Steve Majewski / UVA Alderman Library
From: archivesspace_users_group-bounces at lyralists.lyrasis.org <archivesspace_users_group-bounces at lyralists.lyrasis.org> on behalf of Custer, Mark <mark.custer at yale.edu>
Sent: Wednesday, August 30, 2017 1:51:42 PM
To: archivesspace_users_group at lyralists.lyrasis.org
Subject: Re: [Archivesspace_Users_Group] Customizing the Public Interface PDF

Alice, all:

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<https://urldefense.proofpoint.com/v2/url?u=https-3A__github.com_archivesspace_archivesspace_tree_master_public_app_views_pdf&d=DwMF-g&c=cjytLXgP8ixuoHflwc-poQ&r=7Ez68qVcrmRD6nn1FqwoHBDEOxeRUCPm3xGvnFT0zjU&m=4Rbb0_6bO9B-pMke09p21X77miFOuKzWHbF0FL5WEMo&s=UUMh8w8a6-YyxclJZtQn4GGQMSZ8XNJG4KkPQungjKU&e=>

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:

        <div class="logo">
             <img src="/assets/images/logo.png"/>

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

Greetings all,

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!

Alice Tippit
Developer-Metadata & Discovery Services
Northwestern University Library
Northwestern University
1970 Campus Drive
Evanston, IL 60208
a-tippit at northwestern.edu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lyralists.lyrasis.org/pipermail/archivesspace_users_group/attachments/20170830/287f0650/attachment.html>

More information about the Archivesspace_Users_Group mailing list