Fix single pdf plot

Fixes https://gitlab.com/kicad/code/kicad/-/issues/19501
This commit is contained in:
Marek Roszko
2025-01-05 13:21:19 -05:00
parent 82c7736087
commit 39ab530db3
+7 -4
View File
@@ -109,8 +109,9 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath, const LSEQ& aLayersToPlot,
jobfile_writer->AddGbrFile( layer, fullname );
}
if( m_plotOpts.GetFormat() != PLOT_FORMAT::PDF || !m_plotOpts.m_PDFSingle
|| ( i == 0 && m_plotOpts.GetFormat() == PLOT_FORMAT::PDF
if( m_plotOpts.GetFormat() != PLOT_FORMAT::PDF
|| !m_plotOpts.m_PDFSingle
|| ( pageNum == 1 && m_plotOpts.GetFormat() == PLOT_FORMAT::PDF
&& m_plotOpts.m_PDFSingle ) )
{
// this will only be used by pdf
@@ -171,8 +172,10 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath, const LSEQ& aLayersToPlot,
// last page
if( m_plotOpts.GetFormat() != PLOT_FORMAT::PDF || !m_plotOpts.m_PDFSingle
|| i == aLayersToPlot.size() - 1 )
if( m_plotOpts.GetFormat() != PLOT_FORMAT::PDF
|| !m_plotOpts.m_PDFSingle
|| i == aLayersToPlot.size() - 1
|| pageNum == finalPageCount )
{
plotter->EndPlot();
delete plotter->RenderSettings();