eeschema: set title of plotted pdf to sheet title
Fixes: lp:1656956 https://bugs.launchpad.net/kicad/+bug/1656956
This commit is contained in:
parent
2de913797a
commit
550a1ea4d6
|
@ -7,7 +7,7 @@
|
|||
* This program source code file is part of KiCad, a free EDA CAD application.
|
||||
*
|
||||
* Copyright (C) 1992-2012 Lorenzo Marcantonio, l.marcantonio@logossrl.com
|
||||
* Copyright (C) 1992-2012 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
* Copyright (C) 1992-2017 KiCad Developers, see AUTHORS.txt for contributors.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License
|
||||
|
@ -692,6 +692,14 @@ bool PDF_PLOTTER::EndPlot()
|
|||
time_t ltime = time( NULL );
|
||||
strftime( date_buf, 250, "D:%Y%m%d%H%M%S",
|
||||
localtime( <ime ) );
|
||||
|
||||
if( title.IsEmpty() )
|
||||
{
|
||||
// Windows uses '\' and other platforms ue '/' as sepatator
|
||||
title = filename.AfterLast('\\');
|
||||
title = title.AfterLast('/');
|
||||
}
|
||||
|
||||
fprintf( outputFile,
|
||||
"<<\n"
|
||||
"/Producer (KiCAD PDF)\n"
|
||||
|
@ -701,7 +709,7 @@ bool PDF_PLOTTER::EndPlot()
|
|||
"/Trapped false\n",
|
||||
date_buf,
|
||||
TO_UTF8( creator ),
|
||||
TO_UTF8( filename ) );
|
||||
TO_UTF8( title ) );
|
||||
|
||||
fputs( ">>\n", outputFile );
|
||||
closePdfObject();
|
||||
|
|
|
@ -62,6 +62,7 @@ void DIALOG_PLOT_SCHEMATIC::createPDFFile( bool aPlotAll, bool aPlotFrameRef )
|
|||
plotter->SetDefaultLineWidth( GetDefaultLineThickness() );
|
||||
plotter->SetColorMode( getModeColor() );
|
||||
plotter->SetCreator( wxT( "Eeschema-PDF" ) );
|
||||
plotter->SetTitle( m_parent->GetTitleBlock().GetTitle() );
|
||||
|
||||
wxString msg;
|
||||
wxFileName plotFileName;
|
||||
|
|
|
@ -153,6 +153,11 @@ public:
|
|||
creator = aCreator;
|
||||
}
|
||||
|
||||
virtual void SetTitle( const wxString& aTitle )
|
||||
{
|
||||
title = aTitle;
|
||||
}
|
||||
|
||||
/**
|
||||
* Function AddLineToHeader
|
||||
* Add a line to the list of free lines to print at the beginning of the file
|
||||
|
@ -539,6 +544,7 @@ protected: // variables used in most of plotters:
|
|||
wxPoint penLastpos;
|
||||
wxString creator;
|
||||
wxString filename;
|
||||
wxString title;
|
||||
PAGE_INFO pageInfo;
|
||||
/// Paper size in IU - not in mils
|
||||
wxSize paperSize;
|
||||
|
|
Loading…
Reference in New Issue