Skip to content

Instantly share code, notes, and snippets.

@brianzelip
Created October 31, 2023 16:24
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save brianzelip/044cf4f23f7f9a9dfc9abed7f00db7fe to your computer and use it in GitHub Desktop.
Save brianzelip/044cf4f23f7f9a9dfc9abed7f00db7fe to your computer and use it in GitHub Desktop.
Output the HTML from ArchivesSpace PUI pdf generation

Output the HTML from ArchivesSpace PUI pdf generation

The following snippet was provided by @avatar382 during review of archivesspace/archivesspace#3021.

It helps debug record pdfs generated by the PUI by writing the HTML that goes into the pdf generation to a local file for review after the fact. Yet it was also noted that the pdf generation process is a bit of a mystery box, and so the HTML is just an approximation.

The following snippet was inserted at https://github.com/archivesspace/archivesspace/blob/ba792de563684bc57792372cf3a68e4f53b67bd3/public/app/models/finding_aid_pdf.rb#L90.

STDERR.puts "++++++++++++++++++++++++++++++"
sample = File.open("/Users/bzelip/Desktop/manny_pdf2.html", "w")
out_html.open
out_html.each_line do |line|
  sample.write(line)
end
out_html.close
sample.close

STDERR.puts out_html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment