KiCad PCB EDA Suite
Loading...
Searching...
No Matches
printing.cpp File Reference
#include <printing.h>
#include <windows.h>
#include <algorithm>
#include <cmath>
#include <map>
#include <utility>
#include <roapi.h>
#include <winrt/base.h>
#include <winrt/Windows.Foundation.h>
#include <winrt/Windows.Foundation.Collections.h>
#include <winrt/Windows.Graphics.Printing.h>
#include <winrt/Windows.UI.Xaml.h>
#include <winrt/Windows.UI.Xaml.Controls.h>
#include <winrt/Windows.UI.Xaml.Media.h>
#include <winrt/Windows.UI.Xaml.Printing.h>
#include <winrt/Windows.UI.Xaml.Hosting.h>
#include <winrt/Windows.Storage.h>
#include <winrt/Windows.Storage.Streams.h>
#include <winrt/Windows.Data.Pdf.h>
#include <winrt/Windows.Graphics.Imaging.h>
#include <winrt/Windows.UI.Xaml.Media.Imaging.h>
#include <wx/log.h>

Go to the source code of this file.

Classes

struct  ManagedImage
 
class  KIPLATFORM::PRINTING::WIN_PDF_PRINTER
 

Namespaces

namespace  KIPLATFORM
 
namespace  KIPLATFORM::PRINTING
 

Functions

virtual HRESULT STDMETHODCALLTYPE ShowPrintUIForWindowAsync (HWND appWindow, void **operation)=0
 
virtual HRESULT STDMETHODCALLTYPE get_WindowHandle (HWND *hWnd)=0
 
static std::pair< uint32_t, uint32_t > DpToPixels (winrt::Windows::Data::Pdf::PdfPage const &page, double dpi)
 
static ManagedImage RenderPdfPageToImage (winrt::Windows::Data::Pdf::PdfDocument const &pdf, uint32_t pageIndex, double dpi)
 
static std::wstring KIPLATFORM::PRINTING::Utf8ToWide (std::string const &s)
 
PRINT_RESULT KIPLATFORM::PRINTING::PrintPDF (const std::string &aFile)
 

Variables

IPrintManagerInterop __pad0__
 
IPrintManagerInterop REFIID riid
 
IPrintManagerInterop REFIID void ** printManager = 0
 
IDesktopWindowXamlSourceNative __pad1__
 

Function Documentation

◆ DpToPixels()

static std::pair< uint32_t, uint32_t > DpToPixels ( winrt::Windows::Data::Pdf::PdfPage const & page,
double dpi )
inlinestatic

Definition at line 89 of file windows/printing.cpp.

References scale.

Referenced by RenderPdfPageToImage().

◆ get_WindowHandle()

virtual HRESULT STDMETHODCALLTYPE get_WindowHandle ( HWND * hWnd)
pure virtual

◆ RenderPdfPageToImage()

static ManagedImage RenderPdfPageToImage ( winrt::Windows::Data::Pdf::PdfDocument const & pdf,
uint32_t pageIndex,
double dpi )
static

Definition at line 122 of file windows/printing.cpp.

References DpToPixels(), and PRINTING_TRACE.

Referenced by KIPLATFORM::PRINTING::WIN_PDF_PRINTER::Run().

◆ ShowPrintUIForWindowAsync()

virtual HRESULT STDMETHODCALLTYPE ShowPrintUIForWindowAsync ( HWND appWindow,
void ** operation )
pure virtual

Variable Documentation

◆ __pad0__

IPrintManagerInterop __pad0__

Definition at line 64 of file windows/printing.cpp.

◆ __pad1__

IDesktopWindowXamlSourceNative __pad1__

Definition at line 79 of file windows/printing.cpp.

◆ printManager

IPrintManagerInterop REFIID void** printManager = 0

Definition at line 70 of file windows/printing.cpp.

Referenced by KIPLATFORM::PRINTING::WIN_PDF_PRINTER::Run().

◆ riid

IPrintManagerInterop REFIID riid

Definition at line 69 of file windows/printing.cpp.