5440b4ccf5796778b6a65186bf83c17970f00d7a
markd
  Sun Aug 16 18:43:46 2026 -0700
Support PDF output in hgRenderTracks via hgt.psOutput. refs #38118

hgRenderTracks had PDF output wired up behind a compile-time PDF_OUTPUT define
that was set to 0, so it could only be reached by editing and rebuilding.
Select it at runtime with hgt.psOutput=on instead, which is the same variable
the hgTracks View->PDF menu item already uses.  PNG remains the default.

Also return from handlePostscript after doTrackForm when trackImgOnly is set.
In that case makeActiveImage has already converted the eps, written the PDF to
stdout and unlinked the eps, so the convertEpsToPdf that follows aborted on the
missing file.  The client never saw it because the PDF was already flushed and
hPrintDisable swallowed the error page, but every request logged
"Couldn't open ... .eps" to the apache error log.

Document the new parameter in the hgRenderTracks section of customTrackText.html
and in the hgRenderTracks tip in allTipsRaw.html.

diff --git src/hg/htdocs/allTipsRaw.html src/hg/htdocs/allTipsRaw.html
index 310ed650b88..399a54f1237 100644
--- src/hg/htdocs/allTipsRaw.html
+++ src/hg/htdocs/allTipsRaw.html
@@ -1,24 +1,24 @@
 You can use the <a href="/cgi-bin/hgVai" target="_blank">Variant Annotation Integrator</a> to <b>predict functional effects of variants</b> on transcripts, and add annotations and information to the variants, such as <b>conservation score</b> and its <b>HGVS nomenclature</b>. It supports <b>VCF</b> upload and other formats.
 The Browser tracks display offers <b>keyboard shortcuts</b> for most common actions, including <b>zooming</b>, <b>highlighting</b>, and <b>viewing DNA</b>. Press the <b>question mark (?)</b> key from the tracks display to see all shortcuts.
 You can right-click most items to <b>zoom in</b> on them, or <b><span style="background-color: #ffff00;">highlight</span></b> them in the image. For gene tracks, you can also <b>zoom to specific exons</b> or <b>codons</b>. </p><p style="margin: 0;"><img src="/images/rightClickZoom.png" alt="Right-click menu with zoom and highlight options" style="height: 100px; width: auto; flex-shrink: 0; margin: 0;">
 You can configure the tracks display <b>text size</b>, <b>tooltip text size</b>, <b>label area width</b>, and more by clicking the <button>Configure</button> button below the image, using the keyboard shortcut (type <b>"c" then "f"</b>), or via the menu (<b>Genome Browser</b> then <b>Configure</b>).</p><p style="margin: 0;"><img src="/images/configureOptions.png" alt="Configure options" style="height: 80px; width: auto; flex-shrink: 0; margin: 0;">
 You can <b><span style="color: #00C000;">c</span><span style="color: #CC0000;">o</span><span style="color: #FFB300;">l</span><span style="color: #00C000;">o</span><span style="color: #CC0000;">r</span> and download <span style="color: #0000CC;">D</span><span style="color: #00C000;">N</span><span style="color: #CC0000;">A</span> sequence</b> based on any data tracks. While on the track display, type <b>"v" then "d"</b> (<b>View</b> then <b>DNA Sequence</b>), then select "<b>Extended case/color options</b>" and adjust whether you want annotated bases colored, underlined, or bold, and click "<b>submit</b>".
 From the <a href="/cgi-bin/hgTrackUi?db=hg38&c=chr7&g=ruler" target="_blank">Base Position</a> track description page you can enter <b>motifs to highlight</b>, edit the <b>amino acid reading frames display</b>, and even <b>add a title</b> to the Browser image.</p><p style="margin: 0;"><img src="/images/editTitle.png" alt="Edit image title" style="height: 75px; width: auto; flex-shrink: 0; margin: 0;">
 We offer a <a href="/goldenPath/help/api.html" target="_blank">REST API</a> available under the menu (<b>Downloads</b> then <b>REST API</b>) that can return almost all data available in the Browser in <b>JSON format</b>. It also has additional endpoints, such as <b>/list/schema</b>, which reports every field in a track along with its type and description, and <b>/list/tracks</b>, which returns the configuration settings that drive a track's display.
 We offer a <b>scalable</b> (vector-based) graphic of your current tracks display, suitable for use in <b>publications</b>, via the menu (<b>View</b> then <b>PDF</b>). This PDF can then be used with your editor of choice (e.g. Adobe Illustrator) to edit and export the image as <b>PNG</b>, <b>TIFF</b>, <b>SVG</b>, or <b>PDF</b> with the dpi (dots per inch value) of your choice.
-You can download the <b>PNG</b> image of your current display via <b>right click</b> -> <b>View image</b>, or by changing <b>hgTracks</b> in the URL bar to <b>hgRenderTracks</b>. The hgRenderTracks approach provides <b>programmatic access</b> to the PNG image. For publications, use the menu option (<b>View</b> then <b>PDF</b>) for a scalable image.
+You can download the <b>PNG</b> image of your current display via <b>right click</b> -> <b>View image</b>, or by changing <b>hgTracks</b> in the URL bar to <b>hgRenderTracks</b>. The hgRenderTracks approach provides <b>programmatic access</b> to the PNG image. For a scalable image, add <b>hgt.psOutput=on</b> to the hgRenderTracks URL to get a <b>PDF</b>, or use the menu option (<b>View</b> then <b>PDF</b>).
 We offer <b>Recommended Track Sets</b> for <b>hg19</b> and <b>hg38</b> that display a pre-set browser configuration based on specific areas of interest. These include <b>SNV</b> and <b>CNV</b> interpretation, <b>non-coding variants</b>, <b>exon relevance</b>, <b>problematic regions</b>, and expert panel sets for <b>BRCA1/BRCA2</b> and <b>Lynch syndrome</b>.</p><p style="margin: 0;"><img src="/images/recommendedTrackSetMenu.png" alt="Recommended Track Sets menu" style="height: 75px; width: auto; flex-shrink: 0; margin: 0;">
 The <a href="/cgi-bin/hgCollection" target="_blank">Track Collection Builder</a> (<b>My Data</b> then <b>Track Collection Builder</b>) allows multiple signal tracks to be copied and grouped together into one <b>collection</b>. Signal tracks in a collection can then be <b>overlaid</b>, <b>auto-scaled</b>, <b>sorted by similarity</b>, and more.
 The best way to find what data is available for an assembly is <b>Track Search</b>, found by keyboard shortcut (<b>t</b> then <b>s</b>), in the menu bar (<b>Genome Browser</b> then <b>Track Search</b>) or the <button>Track search</button> button underneath the tracks image. You can also search <b>Public Hub data</b> by using the <b>Advanced</b> tab.
 We offer <b>10 GB of free storage space</b> with every account. First, <a href="/cgi-bin/hgSession" target="_blank">log in or create an account</a>, then go to <a href="/cgi-bin/hgHubConnect#hubUpload" target="_blank">Hub Upload</a> under <b>My Data</b> then <b>Track Hubs</b>. You can also upload <b>bigBed</b> and <b>bigWig</b> files for immediate visualization.
 You can <b>download all visible data</b> in the current browser region from the tracks display. This allows for improved reproducibility, writing variant reports, or publications. <b>Download Current Track Data</b> can be found in the <b>Downloads</b> menu.</p><p style="margin: 0;"><img src="/images/downloadCurrentRegion.png" alt="Download Current Track Data in the Downloads menu" style="height: 115px; width: auto; flex-shrink: 0; margin: 0;">
 We support <a href="/goldenPath/help/query.html" target="_blank">various kinds of searching</a> from the tracks display address bar. You can use <b>HGVS terms</b> (NM_198056.2:c.1A>C), <b>gnomAD style variants</b> (1-55051215-G-GA), <b>BLAT sequences</b> directly from the search box, <b>documentation</b>, and more.
 We have a page that provides information about <b><a href="/accessibility.html" target="_blank">accessibility options</a></b> in the UCSC Genome Browser, including internal configuration settings and third-party tools.
 The best way to find an assembly is the <b>search box</b> on our <a href="/cgi-bin/hgGateway" target="_blank">Gateway page</a>. If your assembly of interest is not available, you can <a href="/assemblySearch.html" target="_blank">request nearly any Genbank assembly</a> as long as it has a <b>GCA</b> or <b>GCF</b> accession.
 The best way to share the URL of a Genome Browser display is with a <a href="/cgi-bin/hgSession" target="_blank">Session link</a>. Displays from copying and pasting the URL from the address bar can <b>change over time</b>, but session links remain <b>stable</b>, which makes them suitable for publications as well. You can even give one a <b>short, readable name</b>: <a href="https://genome.ucsc.edu/s/view/HappyNewYear" target="_blank">https://genome.ucsc.edu/s/view/HappyNewYear</a>
 You can slice the Browser display into different regions, <b>stitched together into a single display</b>, using <a href="/goldenPath/help/multiRegionHelp.html" target="_blank">Multi-region</a> mode. A common use of this mode is to display only the exons of a gene, which is useful when analyzing exon sequencing data. That exon-only view has its own shortcut (<b>"e" then "v"</b>). Enable this mode with the <button>Multi-region</button> button next to the tracks display search bar.</p><p style="margin: 0;"><img src="/images/multiRegionButtonTip.png" alt="Multi region button" style="height: 60px; width: auto; flex-shrink: 0; margin: 0;">
 Our <a href="/cgi-bin/hgTrackUi?db=hg38&c=chr7&g=oligoMatch" target="_blank">Short Match</a> tool allows you to search for any <b>short (2-30 base) sequence</b>. All matches of the motif within the displayed position range are then shown. You can find it by clicking into the <b>Short Match</b> track in the <b>Mapping and Sequencing</b> track group, or via the menu bar from the tracks display (<b>Genome Browser</b> then <b>Short Exact DNA Match</b>).
 Be sure to check our home page often! We regularly update our <a href="/goldenPath/newsarch.html" target="_blank">news</a> with the latest releases, our <b>Meetings and Workshops</b> (come say hello!), and the <b>Sharing data</b> section which displays images and descriptions from our <a href="/cgi-bin/hgPublicSessions" target="_blank">Public Sessions</a> created by <b>users like you</b>. Also, new tips like this one <b>every weekday</b>!
 Want to use the Browser as a <b>teaching tool</b>? We offer <a href="/training/education/index.html" target="_blank">teaching material</a> covering various genomic topics, written for <b>students and educators</b> alike. We also have various slide decks, <a href="/contacts.html" target="_blank">contact us</a> for more details!
 You can <b>convert annotations</b> between different assemblies using the <a href="/cgi-bin/hgLiftOver" target="_blank">LiftOver tool</a>. You can also use the <b>QuickLift</b> feature to immediately lift <b>all your visible annotations</b> from the tracks display using the menu (<b>View</b> then <b>In Other Genomes (Convert)</b>) and selecting the <b>QuickLift tracks</b> box. See our <a href="/goldenPath/help/quickLift.html" target="_blank">QuickLift help page</a> for details.
 While the <a href="/cgi-bin/hgTables" target="_blank">Table Browser</a> allows you to extract data from <b>one track at a time</b>, the <a href="/cgi-bin/hgIntegrator" target="_blank">Data Integrator</a> allows you to select track items that overlap by position, and <b>output all</b> (or selected) fields from up to <b>5 tracks at a time</b>.