Update layer per page.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/20352

(cherry picked from commit 1848401d5b9f786ca49327755c6399a6b29ef91a)
This commit is contained in:
Jeff Young 2025-03-17 09:48:46 +00:00
parent a9adc64f3e
commit d271a47375
5 changed files with 24 additions and 18 deletions

View File

@ -32,6 +32,7 @@ class KICOMMON_API JOB_FP_EXPORT_SVG : public JOB
public:
JOB_FP_EXPORT_SVG();
public:
wxString m_libraryPath;
wxString m_footprint;
@ -39,13 +40,14 @@ public:
wxString m_colorTheme;
bool m_blackAndWhite;
bool m_sketchPadsOnFabLayers;
bool m_hideDNPFPsOnFabLayers;
bool m_sketchDNPFPsOnFabLayers;
bool m_crossoutDNPFPsOnFabLayers;
bool m_blackAndWhite;
bool m_sketchPadsOnFabLayers;
bool m_hideDNPFPsOnFabLayers;
bool m_sketchDNPFPsOnFabLayers;
bool m_crossoutDNPFPsOnFabLayers;
LSEQ m_printMaskLayer;
wxString m_argLayers;
LSEQ m_plotLayerSequence;
};
#endif

View File

@ -231,13 +231,15 @@ bool PCB_PLOTTER::Plot( const wxString& aOutputPath,
} while( copperLayerShouldBeSkipped( nextLayer )
&& ( nextI < layersToPlot.size() - 1 ) );
wxString pageName = m_board->GetLayerName( nextLayer );
wxString sheetName = layerName;
layerName = m_board->GetLayerName( nextLayer );
wxString pageName = layerName;
wxString sheetName = layerName;
static_cast<PDF_PLOTTER*>( plotter )->ClosePage();
static_cast<PDF_PLOTTER*>( plotter )->StartPage( pageNumber, pageName );
setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, sheetName, sheetPath,
pageNumber, finalPageCount );
setupPlotterNewPDFPage( plotter, m_board, &m_plotOpts, layerName, sheetName,
sheetPath, pageNumber, finalPageCount );
}

View File

@ -1851,7 +1851,7 @@ int PCBNEW_JOBS_HANDLER::doFpExportSvg( JOB_FP_EXPORT_SVG* aSvgJob, const FOOTPR
svgPlotOptions.m_outputFile = outputFile.GetFullPath();
svgPlotOptions.m_mirror = false;
svgPlotOptions.m_pageSizeMode = 2; // board bounding box
svgPlotOptions.m_printMaskLayer = aSvgJob->m_printMaskLayer;
svgPlotOptions.m_printMaskLayer = aSvgJob->m_plotLayerSequence;
svgPlotOptions.m_sketchPadsOnFabLayers = aSvgJob->m_sketchPadsOnFabLayers;
svgPlotOptions.m_hideDNPFPsOnFabLayers = aSvgJob->m_hideDNPFPsOnFabLayers;
svgPlotOptions.m_sketchDNPFPsOnFabLayers = aSvgJob->m_sketchDNPFPsOnFabLayers;

View File

@ -163,8 +163,9 @@ PLOTTER* StartPlotBoard( BOARD* aBoard, const PCB_PLOT_PARAMS* aPlotOpts, int aL
const int aPageCount = 1);
void setupPlotterNewPDFPage( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS* aPlotOpts,
const wxString& aSheetName, const wxString& aSheetPath,
const wxString& aPageNumber, int aPageCount );
const wxString& aLayerName, const wxString& aSheetName,
const wxString& aSheetPath, const wxString& aPageNumber,
int aPageCount );
/**
* Plot a sequence of board layer IDs.
*

View File

@ -1354,11 +1354,10 @@ PLOTTER* StartPlotBoard( BOARD *aBoard, const PCB_PLOT_PARAMS *aPlotOpts, int aL
return nullptr;
}
void setupPlotterNewPDFPage( PLOTTER* aPlotter,
BOARD* aBoard,
const PCB_PLOT_PARAMS* aPlotOpts,
const wxString& aSheetName, const wxString& aSheetPath,
const wxString& aPageNumber, int aPageCount )
void setupPlotterNewPDFPage( PLOTTER* aPlotter, BOARD* aBoard, const PCB_PLOT_PARAMS* aPlotOpts,
const wxString& aLayerName, const wxString& aSheetName,
const wxString& aSheetPath, const wxString& aPageNumber,
int aPageCount )
{
// Plot the frame reference if requested
if( aPlotOpts->GetPlotFrameRef() )
@ -1372,4 +1371,6 @@ void setupPlotterNewPDFPage( PLOTTER* aPlotter,
if( aPlotOpts->GetMirror() )
initializePlotter( aPlotter, aBoard, aPlotOpts );
}
aPlotter->RenderSettings()->SetLayerName( aLayerName );
}