Skip to content

Instantly share code, notes, and snippets.

@brianzelip
Created October 31, 2023 16:24
Show Gist options
  • Select an option

  • Save brianzelip/044cf4f23f7f9a9dfc9abed7f00db7fe to your computer and use it in GitHub Desktop.

Select an option

Save brianzelip/044cf4f23f7f9a9dfc9abed7f00db7fe to your computer and use it in GitHub Desktop.

Revisions

  1. brianzelip created this gist Oct 31, 2023.
    20 changes: 20 additions & 0 deletions archivesspace_pui_pdf_to_html.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,20 @@
    # Output the HTML from ArchivesSpace PUI pdf generation

    The following snippet was provided by @avatar382 during review of https://github.com/archivesspace/archivesspace/pull/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.

    ```rb
    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
    ```