| 1 |
/** |
| 2 |
* SPDX-FileCopyrightText: (C) 2010 Dominik Seichter <[email protected]> |
| 3 |
* SPDX-License-Identifier: GPL-2.0-or-later |
| 4 |
*/ |
| 5 |
|
| 6 |
#ifndef _DUMMY_CONVERTER_H_ |
| 7 |
#define _DUMMY_CONVERTER_H_ |
| 8 |
|
| 9 |
#include "iconverter.h" |
| 10 |
|
| 11 |
/** |
| 12 |
* Dummy implementation of a converter, |
| 13 |
* which sets all colors to RGB red. |
| 14 |
*/ |
| 15 |
class DummyConverter : public IConverter |
| 16 |
{ |
| 17 |
public: |
| 18 |
DummyConverter(); |
| 19 |
|
| 20 |
/** |
| 21 |
* A helper method that is called to inform the converter |
| 22 |
* when a new page is analyzed. |
| 23 |
* |
| 24 |
* @param page page object |
| 25 |
* @param pageIndex index of the page in the document |
| 26 |
*/ |
| 27 |
virtual void StartPage(PoDoFo::PdfPage& page, int pageIndex); |
| 28 |
|
| 29 |
/** |
| 30 |
* A helper method that is called to inform the converter |
| 31 |
* when a new page has been analyzed completely. |
| 32 |
* |
| 33 |
* @param page page object |
| 34 |
* @param pageIndex index of the page in the document |
| 35 |
*/ |
| 36 |
virtual void EndPage(PoDoFo::PdfPage& page, int pageIndex); |
| 37 |
|
| 38 |
/** |
| 39 |
* A helper method that is called to inform the converter |
| 40 |
* when a new xobjext is analyzed. |
| 41 |
* |
| 42 |
* @param obj the xobject |
| 43 |
*/ |
| 44 |
virtual void StartXObject(PoDoFo::PdfXObject& obj); |
| 45 |
|
| 46 |
/** |
| 47 |
* A helper method that is called to inform the converter |
| 48 |
* when a xobjext has been analyzed. |
| 49 |
* |
| 50 |
* @param obj the xobject |
| 51 |
*/ |
| 52 |
virtual void EndXObject(PoDoFo::PdfXObject& obj); |
| 53 |
|
| 54 |
/** |
| 55 |
* This method is called whenever a gray stroking color is set |
| 56 |
* using the 'G' PDF command. |
| 57 |
* |
| 58 |
* @param a grayscale color object |
| 59 |
* @returns a new color which should be set instead (any colorspace) |
| 60 |
*/ |
| 61 |
virtual PoDoFo::PdfColor SetStrokingColorGray(const PoDoFo::PdfColor& color); |
| 62 |
|
| 63 |
virtual PoDoFo::PdfColor SetStrokingColorRGB(const PoDoFo::PdfColor& color); |
| 64 |
virtual PoDoFo::PdfColor SetStrokingColorCMYK(const PoDoFo::PdfColor& color); |
| 65 |
|
| 66 |
virtual PoDoFo::PdfColor SetNonStrokingColorGray(const PoDoFo::PdfColor& color); |
| 67 |
virtual PoDoFo::PdfColor SetNonStrokingColorRGB(const PoDoFo::PdfColor& color); |
| 68 |
virtual PoDoFo::PdfColor SetNonStrokingColorCMYK(const PoDoFo::PdfColor& color); |
| 69 |
|
| 70 |
}; |
| 71 |
|
| 72 |
#endif // _DUMMY_CONVERTER_H_ |