77 wxFileName plotFileName;
81 for(
unsigned i = 0; i < sheetList.size(); i++ )
97 fname.Replace(
"/",
"_" );
98 fname.Replace(
"\\",
"_" );
102 if( !plotter->
OpenFile( plotFileName.GetFullPath() ) )
104 msg.Printf(
_(
"Unable to create file \"%s\".\n" ), plotFileName.GetFullPath() );
117 msg.Printf( wxT(
"PDF Plotter exception: %s" ), e.
What() );
138 msg.Printf(
_(
"Plot: \"%s\" OK.\n" ), plotFileName.GetFullPath() );
159 bool aPlotDrawingSheet )
169 if( aPlotDrawingSheet )
182 aScreen->
Plot( aPlotter );
195 plotPage.
SetType( wxT(
"A" ) );
200 plotPage.
SetType( wxT(
"A4" ) );
206 plotPage = actualPage;
212 double scale = std::min( scalex, scaley );
static wxString GetDefaultFileExtension()
void SetCurrentSheet(const SCH_SHEET_PATH &aSheet)
A container for handling SCH_SHEET_PATH objects in a flattened hierarchy.
static int m_pageSizeSelect
const wxString & GetFileName() const
virtual void SetCreator(const wxString &aCreator)
void plotOneSheetPDF(PLOTTER *aPlotter, SCH_SCREEN *aScreen, bool aPlotDrawingSheet)
Instantiate the current locale within a scope in which you are expecting exceptions to be thrown.
Container for all the knowledge about how graphical objects are drawn on any output surface/device.
virtual bool EndPlot() override
Implementation of conversion functions that require both schematic and board internal units.
Plotting engines (PostScript, Gerber, HPGL and DXF)
virtual const COLOR4D & GetBackgroundColor()=0
Return current background color settings.
virtual void SetColor(COLOR4D color)=0
int GetHeightMils() const
virtual void Rect(const wxPoint &p1, const wxPoint &p2, FILL_TYPE fill, int width=USE_DEFAULT_LINE_WIDTH)=0
virtual void StartPage()
Starts a new page in the PDF document.
virtual void SetTitle(const wxString &aTitle)
virtual void SetColorMode(bool aColorMode)
Plot in B/W or color.
int GetVirtualPageNumber() const
void SetRenderSettings(RENDER_SETTINGS *aSettings)
bool SetType(const wxString &aStandardPageDescriptionName, bool aIsPortrait=false)
Set the name of the page type and also the sizes and margins commonly associated with that type name.
const COLOR4D & GetLayerColor(int aLayer) const
Return the color used to draw a layer.
void createPDFFile(bool aPlotAll, bool aPlotDrawingSheet, RENDER_SETTINGS *aRenderSettings)
A pure virtual class used to derive REPORTER objects from.
void UpdateAllScreenReferences()
Update all the symbol references for this sheet path.
const PAGE_INFO & GetPageSettings() const
virtual REPORTER & Report(const wxString &aText, SEVERITY aSeverity=RPT_SEVERITY_UNDEFINED)=0
Report a string with a given severity.
void restoreEnvironment(PDF_PLOTTER *aPlotter, SCH_SHEET_PATH &aOldsheetpath)
Everything done, close the plot and restore the environment.
const wxString & GetPageNumber() const
void setupPlotPagePDF(PLOTTER *aPlotter, SCH_SCREEN *aScreen)
wxString GetScreenDesc() const override
Return a human-readable description of the current screen.
virtual void ClosePage()
Close the current page in the PDF document (and emit its compressed stream)
wxFileName createPlotFileName(const wxString &aPlotFileName, const wxString &aExtension, REPORTER *aReporter=NULL)
Create a file name with an absolute path name.
virtual const wxString What() const
A composite of Problem() and Where()
SCH_EDIT_FRAME * m_parent
Describe the page size and margins of a paper page on which to eventually print or plot.
void BuildSheetList(SCH_SHEET *aSheet, bool aCheckIntegrity)
Build the list of sheets and their sheet path from aSheet.
SCHEMATIC & Schematic() const
wxCheckBox * m_plotBackgroundColor
Handle access to a stack of flattened SCH_SHEET objects by way of a path for creating a flattened sch...
virtual void SetViewport(const wxPoint &aOffset, double aIusPerDecimil, double aScale, bool aMirror)=0
Set the plot offset and scaling for the current plot.
void Plot(PLOTTER *aPlotter)
Plot all the schematic objects to aPlotter.
PROJECT & Prj() const override
Return a reference to the project this schematic is part of.
const PAGE_INFO & GetPageSettings() const override
Base plotter engine class.
RENDER_SETTINGS * RenderSettings()
SCH_SCREEN * LastScreen()
void SetSheetNumberAndCount()
Set the m_ScreenNumber and m_NumberOfScreens members for screens.
SCHEMATIC * Schematic() const
const TITLE_BLOCK & GetTitleBlock() const override
void PlotDrawingSheet(PLOTTER *plotter, const PROJECT *aProject, const TITLE_BLOCK &aTitleBlock, const PAGE_INFO &aPageInfo, const wxString &aSheetNumber, int aSheetCount, const wxString &aSheetDesc, const wxString &aFilename, COLOR4D aColor, bool aIsFirstPage)
void SortByPageNumbers(bool aUpdateVirtualPageNums=true)
Sorts the list of sheets by page number.
wxString GetUniqueFilenameForCurrentSheet()
virtual bool OpenFile(const wxString &aFullFilename) override
Open or create the plot file aFullFilename.
SCH_SHEET_PATH & GetCurrentSheet() const
const wxString & GetTitle() const
WX_HTML_REPORT_PANEL * m_MessagesBox
Definition of the SCH_SHEET_PATH and SCH_SHEET_LIST classes for Eeschema.
virtual bool StartPlot() override
The PDF engine supports multiple pages; the first one is opened 'for free' the following are to be cl...
PAGE_INFO & PageSettings()
void SetPortrait(bool aIsPortrait)
Rotate the paper page 90 degrees.
Hold an error message and may be used when throwing exceptions containing meaningful error messages.
virtual void SetPageSettings(const PAGE_INFO &aPageSettings)
A color representation with 4 components: red, green, blue, alpha.
bool GetColorMode() const