ADDED: optional PDF metadata from AUTHOR and SUBJECT variables.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/17289
This commit is contained in:
Jeff Young 2024-03-13 23:40:18 +00:00
parent 34ec57958d
commit e30b6398b7
21 changed files with 6351 additions and 6051 deletions

View File

@ -34,6 +34,7 @@ JOB_EXPORT_SCH_PLOT::JOB_EXPORT_SCH_PLOT( bool aIsCli, SCH_PLOT_FORMAT aPlotForm
m_HPGLPenSize( 1.0 ),
m_HPGLPaperSizeSelect( JOB_HPGL_PAGE_SIZE::DEFAULT ),
m_PDFPropertyPopups( true ),
m_PDFMetadata( true ),
m_theme(),
m_outputDirectory(),
m_outputFile(),

View File

@ -91,6 +91,7 @@ public:
double m_HPGLPenSize; // for HPGL format only: pen size
JOB_HPGL_PAGE_SIZE m_HPGLPaperSizeSelect;
bool m_PDFPropertyPopups;
bool m_PDFMetadata;
wxString m_theme;
wxString m_outputDirectory;

View File

@ -24,6 +24,7 @@ outputformat
pcbplotparams
pdf_back_fp_property_popups
pdf_front_fp_property_popups
pdf_metadata
plotframeref
plotfptext
plotinvisibletext

View File

@ -1463,10 +1463,14 @@ function ShM(aEntries) {
"/Producer (KiCad PDF)\n"
"/CreationDate (%s)\n"
"/Creator %s\n"
"/Title %s\n",
"/Title %s\n"
"/Author %s\n"
"/Subject %s\n",
date_buf,
encodeStringForPlotter( m_creator ).c_str(),
encodeStringForPlotter( m_title ).c_str() );
encodeStringForPlotter( m_title ).c_str(),
encodeStringForPlotter( m_author ).c_str(),
encodeStringForPlotter( m_subject ).c_str() );
fputs( ">>\n", m_outputFile );
closePdfObject();

View File

@ -111,6 +111,7 @@ void DIALOG_PLOT_SCHEMATIC::initDlg()
setOpenFileAfterPlot( cfg->m_PlotPanel.open_file_after_plot );
m_plotPDFPropertyPopups->SetValue( cfg->m_PlotPanel.pdf_property_popups );
m_plotPDFMetadata->SetValue( cfg->m_PlotPanel.pdf_metadata );
// HPGL plot origin and unit system configuration
m_plotOriginOpt->SetSelection( cfg->m_PlotPanel.hpgl_origin );
@ -269,6 +270,7 @@ void DIALOG_PLOT_SCHEMATIC::OnUpdateUI( wxUpdateUIEvent& event )
m_openFileAfterPlot->Enable( fmt == PLOT_FORMAT::PDF );
m_plotPDFPropertyPopups->Enable( fmt == PLOT_FORMAT::PDF );
m_plotPDFMetadata->Enable( fmt == PLOT_FORMAT::PDF );
m_paperSizeOption->Set( paperSizes );
m_paperSizeOption->SetSelection( selection );
@ -308,6 +310,7 @@ void DIALOG_PLOT_SCHEMATIC::getPlotOptions( RENDER_SETTINGS* aSettings )
cfg->m_PlotPanel.hpgl_origin = m_plotOriginOpt->GetSelection();
cfg->m_PlotPanel.hpgl_paper_size = static_cast<int>( m_HPGLPaperSizeSelect );
cfg->m_PlotPanel.pdf_property_popups = m_plotPDFPropertyPopups->GetValue();
cfg->m_PlotPanel.pdf_metadata = m_plotPDFMetadata->GetValue();
cfg->m_PlotPanel.open_file_after_plot = getOpenFileAfterPlot();
// HPGL Pen Size is stored in mm in config
@ -382,6 +385,7 @@ void DIALOG_PLOT_SCHEMATIC::plotSchematic( bool aPlotAll )
plotSettings.m_useBackgroundColor = m_plotBackgroundColor->GetValue();
plotSettings.m_theme = colors->GetFilename();
plotSettings.m_PDFPropertyPopups = m_plotPDFPropertyPopups->GetValue();
plotSettings.m_PDFMetadata = m_plotPDFMetadata->GetValue();
plotSettings.m_HPGLPaperSizeSelect = static_cast<HPGL_PAGE_SIZE>( m_HPGLPaperSizeSelect );
plotSettings.m_HPGLPlotOrigin =
static_cast<HPGL_PLOT_ORIGIN_AND_UNITS>( m_plotOriginOpt->GetSelection() );

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -116,7 +116,7 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
sbOptions->Add( gbSizer1, 1, wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT, 5 );
m_optionsSizer->Add( sbOptions, 1, wxEXPAND|wxRIGHT|wxLEFT, 5 );
m_optionsSizer->Add( sbOptions, 0, wxEXPAND|wxRIGHT|wxLEFT, 5 );
wxBoxSizer* bOptionsRight;
bOptionsRight = new wxBoxSizer( wxVERTICAL );
@ -164,6 +164,11 @@ DIALOG_PLOT_SCHEMATIC_BASE::DIALOG_PLOT_SCHEMATIC_BASE( wxWindow* parent, wxWind
m_plotPDFPropertyPopups->SetValue(true);
sbSizer4->Add( m_plotPDFPropertyPopups, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_plotPDFMetadata = new wxCheckBox( sbSizer4->GetStaticBox(), wxID_ANY, _("Generate metadata from AUTHOR && SUBJECT variables"), wxDefaultPosition, wxDefaultSize, 0 );
m_plotPDFMetadata->SetToolTip( _("Generate PDF document properties from AUTHOR and SUBJECT text variables") );
sbSizer4->Add( m_plotPDFMetadata, 0, wxBOTTOM|wxRIGHT|wxLEFT, 5 );
bOptionsRight->Add( sbSizer4, 1, wxEXPAND|wxTOP|wxRIGHT|wxLEFT, 5 );

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<wxFormBuilder_Project>
<FileVersion major="1" minor="16" />
<object class="Project" expanded="1">
<FileVersion major="1" minor="17"/>
<object class="Project" expanded="true">
<property name="class_decoration"></property>
<property name="code_generation">C++</property>
<property name="disconnect_events">1</property>
@ -29,13 +29,14 @@
<property name="use_array_enum">0</property>
<property name="use_enum">1</property>
<property name="use_microsoft_bom">0</property>
<object class="Dialog" expanded="1">
<object class="Dialog" expanded="true">
<property name="aui_managed">0</property>
<property name="aui_manager_style">wxAUI_MGR_DEFAULT</property>
<property name="bg"></property>
<property name="center"></property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="event_handler">impl_virtual</property>
<property name="extra_style"></property>
@ -58,25 +59,25 @@
<property name="window_style"></property>
<event name="OnClose">OnCloseWindow</event>
<event name="OnUpdateUI">OnUpdateUI</event>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bMainSizer</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">7</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizerDir</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALL|wxALIGN_CENTER_VERTICAL</property>
<property name="proportion">0</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -97,6 +98,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -133,11 +135,11 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="false">
<property name="border">4</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxTextCtrl" expanded="0">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -158,6 +160,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -197,11 +200,11 @@
<property name="window_style"></property>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxBitmapButton" expanded="1">
<object class="wxBitmapButton" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -227,6 +230,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -273,20 +277,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">m_optionsSizer</property>
<property name="orient">wxHORIZONTAL</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="0">
<object class="sizeritem" expanded="false">
<property name="border">5</property>
<property name="flag">wxALIGN_TOP|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">0</property>
<object class="wxRadioBox" expanded="0">
<object class="wxRadioBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -308,6 +312,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -349,11 +354,11 @@
<event name="OnRadioBox">OnPlotFormatSelection</event>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="true">
<property name="id">wxID_ANY</property>
<property name="label">Options</property>
<property name="minimum_size"></property>
@ -361,11 +366,11 @@
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">1</property>
<object class="wxGridBagSizer" expanded="1">
<object class="wxGridBagSizer" expanded="true">
<property name="empty_cell_size">-1,10</property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
@ -376,14 +381,14 @@
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="vgap">5</property>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -404,6 +409,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -440,14 +446,14 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">2</property>
<property name="column">1</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxChoice" expanded="0">
<object class="wxChoice" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -469,6 +475,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -508,14 +515,14 @@
<event name="OnChoice">OnPageSizeSelected</event>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">2</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="0">
<object class="wxCheckBox" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -537,6 +544,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -575,14 +583,14 @@
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">3</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -603,6 +611,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -639,14 +648,14 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">2</property>
<property name="column">1</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="row">3</property>
<property name="rowspan">1</property>
<object class="wxChoice" expanded="0">
<object class="wxChoice" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -668,6 +677,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -706,14 +716,14 @@
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="1">
<object class="gbsizeritem" expanded="true">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">4</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="1">
<object class="wxStaticText" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -734,6 +744,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -770,14 +781,14 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="1">
<object class="gbsizeritem" expanded="true">
<property name="border">5</property>
<property name="colspan">2</property>
<property name="column">1</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
<property name="row">4</property>
<property name="rowspan">1</property>
<object class="wxChoice" expanded="1">
<object class="wxChoice" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -799,6 +810,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -837,14 +849,14 @@
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="1">
<object class="gbsizeritem" expanded="true">
<property name="border">5</property>
<property name="colspan">3</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="row">5</property>
<property name="rowspan">1</property>
<object class="wxCheckBox" expanded="1">
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -866,6 +878,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -904,14 +917,14 @@
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">7</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -932,6 +945,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -968,14 +982,14 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxEXPAND|wxALIGN_CENTER_VERTICAL</property>
<property name="row">7</property>
<property name="rowspan">1</property>
<object class="wxTextCtrl" expanded="0">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -996,6 +1010,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1035,14 +1050,14 @@
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">2</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">7</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1063,6 +1078,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1103,20 +1119,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bOptionsRight</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticBoxSizer" expanded="true">
<property name="id">wxID_ANY</property>
<property name="label">HPGL Options</property>
<property name="minimum_size"></property>
@ -1124,11 +1140,11 @@
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxEXPAND|wxLEFT|wxRIGHT</property>
<property name="proportion">1</property>
<object class="wxGridBagSizer" expanded="1">
<object class="wxGridBagSizer" expanded="true">
<property name="empty_cell_size"></property>
<property name="flexible_direction">wxBOTH</property>
<property name="growablecols">1</property>
@ -1139,14 +1155,14 @@
<property name="non_flexible_grow_mode">wxFLEX_GROWMODE_SPECIFIED</property>
<property name="permission">none</property>
<property name="vgap">3</property>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1167,6 +1183,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1203,14 +1220,14 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">2</property>
<property name="column">1</property>
<property name="flag">wxEXPAND</property>
<property name="row">0</property>
<property name="rowspan">1</property>
<object class="wxChoice" expanded="0">
<object class="wxChoice" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1232,6 +1249,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1270,14 +1288,14 @@
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">0</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1298,6 +1316,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1334,14 +1353,14 @@
<property name="wrap">-1</property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">1</property>
<property name="flag">wxALIGN_CENTER_VERTICAL|wxEXPAND</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxTextCtrl" expanded="0">
<object class="wxTextCtrl" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1362,6 +1381,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1401,14 +1421,14 @@
<property name="window_style"></property>
</object>
</object>
<object class="gbsizeritem" expanded="0">
<object class="gbsizeritem" expanded="false">
<property name="border">5</property>
<property name="colspan">1</property>
<property name="column">2</property>
<property name="flag">wxALIGN_CENTER_VERTICAL</property>
<property name="row">1</property>
<property name="rowspan">1</property>
<object class="wxStaticText" expanded="0">
<object class="wxStaticText" expanded="false">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1429,6 +1449,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1469,11 +1490,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<object class="wxStaticBoxSizer" expanded="true">
<property name="id">wxID_ANY</property>
<property name="label">PDF Options</property>
<property name="minimum_size"></property>
@ -1481,11 +1502,11 @@
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1507,6 +1528,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1545,25 +1567,11 @@
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="1">
<property name="id">wxID_ANY</property>
<property name="label">Other options</property>
<property name="minimum_size"></property>
<property name="name">m_otherOptions</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="1">
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1585,6 +1593,86 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
<property name="font"></property>
<property name="gripper">0</property>
<property name="hidden">0</property>
<property name="id">wxID_ANY</property>
<property name="label">Generate metadata from AUTHOR &amp;&amp; SUBJECT variables</property>
<property name="max_size"></property>
<property name="maximize_button">0</property>
<property name="maximum_size"></property>
<property name="min_size"></property>
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_plotPDFMetadata</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
<property name="permission">protected</property>
<property name="pin_button">1</property>
<property name="pos"></property>
<property name="resize">Resizable</property>
<property name="show">1</property>
<property name="size"></property>
<property name="style"></property>
<property name="subclass">; ; forward_declare</property>
<property name="toolbar_pane">0</property>
<property name="tooltip">Generate PDF document properties from AUTHOR and SUBJECT text variables</property>
<property name="validator_data_type"></property>
<property name="validator_style">wxFILTER_NONE</property>
<property name="validator_type">wxDefaultValidator</property>
<property name="validator_variable"></property>
<property name="window_extra_style"></property>
<property name="window_name"></property>
<property name="window_style"></property>
</object>
</object>
</object>
</object>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxStaticBoxSizer" expanded="true">
<property name="id">wxID_ANY</property>
<property name="label">Other options</property>
<property name="minimum_size"></property>
<property name="name">m_otherOptions</property>
<property name="orient">wxVERTICAL</property>
<property name="parent">1</property>
<property name="permission">protected</property>
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxBOTTOM|wxRIGHT|wxLEFT</property>
<property name="proportion">0</property>
<object class="wxCheckBox" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
<property name="TopDockable">1</property>
<property name="aui_layer"></property>
<property name="aui_name"></property>
<property name="aui_position"></property>
<property name="aui_row"></property>
<property name="best_size"></property>
<property name="bg"></property>
<property name="caption"></property>
<property name="caption_visible">1</property>
<property name="center_pane">0</property>
<property name="checked">0</property>
<property name="close_button">1</property>
<property name="context_help"></property>
<property name="context_menu">1</property>
<property name="default_pane">0</property>
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1629,20 +1717,20 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxBoxSizer" expanded="1">
<object class="wxBoxSizer" expanded="true">
<property name="minimum_size"></property>
<property name="name">bSizerMsgPanel</property>
<property name="orient">wxVERTICAL</property>
<property name="permission">none</property>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxEXPAND|wxTOP|wxRIGHT|wxLEFT</property>
<property name="proportion">1</property>
<object class="wxPanel" expanded="1">
<object class="wxPanel" expanded="true">
<property name="BottomDockable">1</property>
<property name="LeftDockable">1</property>
<property name="RightDockable">1</property>
@ -1663,6 +1751,7 @@
<property name="dock">Dock</property>
<property name="dock_fixed">0</property>
<property name="docking">Left</property>
<property name="drag_accept_files">0</property>
<property name="enabled">1</property>
<property name="fg"></property>
<property name="floatable">1</property>
@ -1697,11 +1786,11 @@
</object>
</object>
</object>
<object class="sizeritem" expanded="1">
<object class="sizeritem" expanded="true">
<property name="border">5</property>
<property name="flag">wxALL|wxEXPAND</property>
<property name="proportion">0</property>
<object class="wxStdDialogButtonSizer" expanded="1">
<object class="wxStdDialogButtonSizer" expanded="true">
<property name="Apply">1</property>
<property name="Cancel">1</property>
<property name="ContextHelp">0</property>

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.0-39-g3487c3cb)
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -67,6 +67,7 @@ class DIALOG_PLOT_SCHEMATIC_BASE : public DIALOG_SHIM
wxTextCtrl* m_penWidthCtrl;
wxStaticText* m_penWidthUnits;
wxCheckBox* m_plotPDFPropertyPopups;
wxCheckBox* m_plotPDFMetadata;
wxStaticBoxSizer* m_otherOptions;
wxCheckBox* m_openFileAfterPlot;
WX_HTML_REPORT_PANEL* m_MessagesBox;

View File

@ -213,6 +213,7 @@ int EESCHEMA_JOBS_HANDLER::JobExportPlot( JOB* aJob )
settings.m_HPGLPenSize = aPlotJob->m_HPGLPenSize;
settings.m_HPGLPlotOrigin = hpglOrigin;
settings.m_PDFPropertyPopups = aPlotJob->m_PDFPropertyPopups;
settings.m_PDFMetadata = aPlotJob->m_PDFMetadata;
settings.m_outputDirectory = aPlotJob->m_outputDirectory;
settings.m_outputFile = aPlotJob->m_outputFile;
settings.m_pageSizeSelect = pageSizeSelect;

View File

@ -497,6 +497,9 @@ EESCHEMA_SETTINGS::EESCHEMA_SETTINGS() :
m_params.emplace_back( new PARAM<bool>( "plot.pdf_property_popups",
&m_PlotPanel.pdf_property_popups, true ) );
m_params.emplace_back( new PARAM<bool>( "plot.pdf_metadata",
&m_PlotPanel.pdf_metadata, true ) );
m_params.emplace_back( new PARAM<int>( "plot.hpgl_paper_size",
&m_PlotPanel.hpgl_paper_size, 0 ) );

View File

@ -250,6 +250,7 @@ public:
double hpgl_pen_size;
int hpgl_origin;
bool pdf_property_popups;
bool pdf_metadata;
bool open_file_after_plot;
};

View File

@ -153,6 +153,19 @@ void SCH_PLOTTER::createPDFFile( const SCH_PLOT_SETTINGS& aPlotSettings,
SCH_SCREEN* screen = m_schematic->CurrentSheet().LastScreen();
wxString sheetName = sheetList[i].Last()->GetFields()[SHEETNAME].GetShownText( false );
if( aPlotSettings.m_PDFMetadata )
{
msg = wxS( "AUTHOR" );
if( m_schematic->ResolveTextVar( &sheetList[i], &msg, 0 ) )
plotter->SetAuthor( msg );
msg = wxS( "SUBJECT" );
if( m_schematic->ResolveTextVar( &sheetList[i], &msg, 0 ) )
plotter->SetSubject( msg );
}
if( i == 0 )
{
try

View File

@ -88,6 +88,7 @@ struct SCH_PLOT_SETTINGS
double m_HPGLPenSize; // for HPGL format only: pen size
HPGL_PAGE_SIZE m_HPGLPaperSizeSelect;
bool m_PDFPropertyPopups;
bool m_PDFMetadata;
wxString m_theme;
wxString m_outputDirectory;
@ -104,6 +105,7 @@ struct SCH_PLOT_SETTINGS
m_HPGLPenSize( 1.0 ),
m_HPGLPaperSizeSelect( HPGL_PAGE_SIZE::DEFAULT ),
m_PDFPropertyPopups( false ),
m_PDFMetadata( false ),
m_theme(),
m_outputDirectory(),
m_outputFile(),

View File

@ -151,8 +151,9 @@ public:
virtual void SetDash( int aLineWidth, LINE_STYLE aLineStyle ) = 0;
virtual void SetCreator( const wxString& aCreator ) { m_creator = aCreator; }
virtual void SetTitle( const wxString& aTitle ) { m_title = aTitle; }
virtual void SetAuthor( const wxString& aAuthor ) { m_author = aAuthor; }
virtual void SetSubject( const wxString& aSubject ) { m_subject = aSubject; }
/**
* Add a line to the list of free lines to print at the beginning of the file.
@ -669,6 +670,8 @@ protected: // variables used in most of plotters:
wxString m_creator;
wxString m_filename;
wxString m_title;
wxString m_author;
wxString m_subject;
PAGE_INFO m_pageInfo;
VECTOR2I m_paperSize; // Paper size in IU - not in mils

View File

@ -36,6 +36,7 @@
#define ARG_HPGL_ORIGIN "--origin"
#define ARG_PAGES "--pages"
#define ARG_EXCLUDE_PDF_PROPERTY_POPUPS "--exclude-pdf-property-popups"
#define ARG_EXCLUDE_PDF_METADATA "--exclude-pdf-metadata"
const JOB_HPGL_PLOT_ORIGIN_AND_UNITS hpgl_origin_ops[4] = {
JOB_HPGL_PLOT_ORIGIN_AND_UNITS::PLOTTER_BOT_LEFT,
@ -79,6 +80,10 @@ CLI::SCH_EXPORT_PLOT_COMMAND::SCH_EXPORT_PLOT_COMMAND( const std::string& aName,
m_argParser.add_argument( ARG_EXCLUDE_PDF_PROPERTY_POPUPS )
.help( UTF8STDSTR( _( "Do not generate property popups in PDF" ) ) )
.flag();
m_argParser.add_argument( ARG_EXCLUDE_PDF_METADATA )
.help( UTF8STDSTR( _( "Do not generate PDF metadata from AUTHOR and SUBJECT variables" ) ) )
.flag();
}
if( aPlotFormat == SCH_PLOT_FORMAT::PDF
@ -178,6 +183,7 @@ int CLI::SCH_EXPORT_PLOT_COMMAND::doPerform( KIWAY& aKiway )
else if( m_plotFormat == SCH_PLOT_FORMAT::PDF )
{
plotJob->m_PDFPropertyPopups = !m_argParser.get<bool>( ARG_EXCLUDE_PDF_PROPERTY_POPUPS );
plotJob->m_PDFMetadata = !m_argParser.get<bool>( ARG_EXCLUDE_PDF_METADATA );
}
int exitCode = aKiway.ProcessJob( KIWAY::FACE_SCH, plotJob.get() );

View File

@ -367,6 +367,7 @@ void DIALOG_PLOT::init_Dialog()
m_PDFColorChoice->SetSelection( m_plotOpts.GetBlackAndWhite() ? 1 : 0 );
m_frontFPPropertyPopups->SetValue( m_plotOpts.m_PDFFrontFPPropertyPopups );
m_backFPPropertyPopups->SetValue( m_plotOpts.m_PDFBackFPPropertyPopups );
m_pdfMetadata->SetValue( m_plotOpts.m_PDFMetadata );
// Initialize a few other parameters, which can also be modified
// from the drill dialog
@ -930,6 +931,7 @@ void DIALOG_PLOT::applyPlotSettings()
tempOptions.SetBlackAndWhite( !!m_PDFColorChoice->GetSelection() );
tempOptions.m_PDFFrontFPPropertyPopups = m_frontFPPropertyPopups->GetValue();
tempOptions.m_PDFBackFPPropertyPopups = m_backFPPropertyPopups->GetValue();
tempOptions.m_PDFMetadata = m_pdfMetadata->GetValue();
}
else
{
@ -1235,6 +1237,21 @@ void DIALOG_PLOT::Plot( wxCommandEvent& event )
if( plotter )
{
plotter->SetTitle( ExpandTextVars( board->GetTitleBlock().GetTitle(), &textResolver ) );
if( m_plotOpts.m_PDFMetadata )
{
msg = wxS( "AUTHOR" );
if( board->ResolveTextVar( &msg, 0 ) )
plotter->SetAuthor( msg );
msg = wxS( "SUBJECT" );
if( board->ResolveTextVar( &msg, 0 ) )
plotter->SetSubject( msg );
}
PlotBoardLayers( board, plotter, plotSequence, m_plotOpts );
PlotInteractiveLayer( board, plotter, m_plotOpts );
plotter->EndPlot();

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -413,6 +413,11 @@ DIALOG_PLOT_BASE::DIALOG_PLOT_BASE( wxWindow* parent, wxWindowID id, const wxStr
m_backFPPropertyPopups = new wxCheckBox( m_PDFOptionsSizer->GetStaticBox(), wxID_ANY, _("Generate property popups for back footprints"), wxDefaultPosition, wxDefaultSize, 0 );
gbSizer4->Add( m_backFPPropertyPopups, wxGBPosition( 2, 0 ), wxGBSpan( 1, 2 ), wxRIGHT|wxLEFT, 5 );
m_pdfMetadata = new wxCheckBox( m_PDFOptionsSizer->GetStaticBox(), wxID_ANY, _("Generate metadata from AUTHOR && SUBJECT variables"), wxDefaultPosition, wxDefaultSize, 0 );
m_pdfMetadata->SetToolTip( _("Generate PDF document properties from AUTHOR and SUBJECT text variables") );
gbSizer4->Add( m_pdfMetadata, wxGBPosition( 3, 0 ), wxGBSpan( 1, 2 ), wxBOTTOM|wxRIGHT|wxLEFT, 5 );
m_PDFOptionsSizer->Add( gbSizer4, 1, wxEXPAND|wxBOTTOM, 5 );

File diff suppressed because it is too large Load Diff

View File

@ -1,5 +1,5 @@
///////////////////////////////////////////////////////////////////////////
// C++ code generated with wxFormBuilder (version 3.10.1-0-g8feb16b)
// C++ code generated with wxFormBuilder (version 4.0.0-0-g0efcecf)
// http://www.wxformbuilder.org/
//
// PLEASE DO *NOT* EDIT THIS FILE!
@ -124,6 +124,7 @@ class DIALOG_PLOT_BASE : public DIALOG_SHIM
wxChoice* m_PDFColorChoice;
wxCheckBox* m_frontFPPropertyPopups;
wxCheckBox* m_backFPPropertyPopups;
wxCheckBox* m_pdfMetadata;
WX_HTML_REPORT_PANEL* m_messagesPanel;
wxBoxSizer* m_sizerButtons;
wxButton* m_buttonDRC;

View File

@ -136,6 +136,7 @@ PCB_PLOT_PARAMS::PCB_PLOT_PARAMS()
m_PDFFrontFPPropertyPopups = true;
m_PDFBackFPPropertyPopups = true;
m_PDFMetadata = true;
// This parameter controls if the NPTH pads will be plotted or not
// it is a "local" parameter
@ -223,6 +224,9 @@ void PCB_PLOT_PARAMS::Format( OUTPUTFORMATTER* aFormatter,
KICAD_FORMAT::FormatBool( aFormatter, aNestLevel + 1,
getTokenName( T_pdf_back_fp_property_popups ),
m_PDFBackFPPropertyPopups );
KICAD_FORMAT::FormatBool( aFormatter, aNestLevel + 1,
getTokenName( T_pdf_metadata ),
m_PDFMetadata );
// DXF options
KICAD_FORMAT::FormatBool( aFormatter, aNestLevel + 1, getTokenName( T_dxfpolygonmode ),
@ -334,6 +338,9 @@ bool PCB_PLOT_PARAMS::IsSameAs( const PCB_PLOT_PARAMS &aPcbPlotParams ) const
if( m_PDFBackFPPropertyPopups != aPcbPlotParams.m_PDFBackFPPropertyPopups )
return false;
if( m_PDFMetadata != aPcbPlotParams.m_PDFMetadata )
return false;
if( m_A4Output != aPcbPlotParams.m_A4Output )
return false;
@ -577,6 +584,10 @@ void PCB_PLOT_PARAMS_PARSER::Parse( PCB_PLOT_PARAMS* aPcbPlotParams )
aPcbPlotParams->m_PDFFrontFPPropertyPopups = parseBool();
break;
case T_pdf_metadata:
aPcbPlotParams->m_PDFMetadata = parseBool();
break;
case T_dxfpolygonmode:
aPcbPlotParams->m_DXFPolygonMode = parseBool();
break;

View File

@ -192,6 +192,7 @@ public:
public:
bool m_PDFFrontFPPropertyPopups; ///< Generate PDF property popup menus for footprints
bool m_PDFBackFPPropertyPopups; ///< on front and/or back of board
bool m_PDFMetadata; ///< Generate PDF metadata for SUBJECT and AUTHOR
private:
friend class PCB_PLOT_PARAMS_PARSER;