wxMaxima
Loading...
Searching...
No Matches
PDFout.h
Go to the documentation of this file.
1// -*- mode: c++; c-file-style: "linux"; c-basic-offset: 2; indent-tabs-mode: nil -*-
2//
3// Copyright (C) 2026 Gunter Königsmann <wxMaxima@physikbuch.de>
4//
5// This program is free software; you can redistribute it and/or modify
6// it under the terms of the GNU General Public License as published by
7// the Free Software Foundation; either version 2 of the License, or
8// (at your option) any later version.
9//
10// This program is distributed in the hope that it will be useful,
11// but WITHOUT ANY WARRANTY; without even the implied warranty of
12// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13// GNU General Public License for more details.
14//
15//
16// You should have received a copy of the GNU General Public License
17// along with this program; if not, write to the Free Software
18// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19//
20// SPDX-License-Identifier: GPL-2.0+
21
22
27#ifndef PDFOUT_H
28#define PDFOUT_H
29
30#include "OutCommon.h"
31#include "precomp.h"
32#include <wx/dataobj.h>
33#include <memory>
34#include <string>
35
50class Pdfout final
51{
52public:
60 Pdfout(const Configuration *const *configuration, std::unique_ptr<Cell> &&tree);
61 ~Pdfout();
62 Pdfout(const Pdfout &) = delete;
63 Pdfout &operator=(const Pdfout &) = delete;
64
66 bool IsOk() const { return !m_pdf.empty(); }
68 const std::string &GetData() const { return m_pdf; }
70 wxSize GetPageSize() const { return m_pageSize; }
71
73 static bool Available();
80 static bool OfferedOnClipboard();
86 static const wxDataFormat &GetDataFormat();
87
88private:
89 OutCommon m_cmn;
90 std::unique_ptr<Cell> m_tree;
91 std::string m_pdf;
92 wxSize m_pageSize;
93};
94
95#endif // PDFOUT_H
This is the header for common code used by various file output modules that render cells to files.
The configuration storage for the current worksheet.
Definition: Configuration.h:102
A collection of common code used in rendering the cells to a non-default output, e....
Definition: OutCommon.h:43
Renders a part of the worksheet as a PDF whose page is exactly as big as it.
Definition: PDFout.h:51
wxSize GetPageSize() const
The page size, in points (1/72 inch)
Definition: PDFout.h:70
static bool OfferedOnClipboard()
Is a PDF offered on the clipboard?
Definition: PDFout.cpp:112
static const wxDataFormat & GetDataFormat()
The clipboard format.
Definition: PDFout.cpp:120
static bool Available()
Was wxMaxima built with wxPdfDocument?
Definition: PDFout.cpp:104
bool IsOk() const
Did rendering work?
Definition: PDFout.h:66
const std::string & GetData() const
The PDF file's bytes; empty if rendering failed.
Definition: PDFout.h:68