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