PdfArray.h   PdfArray.h 
skipping to change at line 62 skipping to change at line 62
/** Create an empty array /** Create an empty array
*/ */
PdfArray(); PdfArray();
/** Create an array and add one value to it. /** Create an array and add one value to it.
* The value is copied. * The value is copied.
* *
* \param var add this object to the array. * \param var add this object to the array.
*/ */
PdfArray( const PdfObject & var ); explicit PdfArray( const PdfObject & var );
/** Deep copy an existing PdfArray /** Deep copy an existing PdfArray
* *
* \param rhs the array to copy * \param rhs the array to copy
*/ */
PdfArray( const PdfArray & rhs ); PdfArray( const PdfArray & rhs );
virtual ~PdfArray(); virtual ~PdfArray();
/** assignment operator
*
* \param rhs the array to assign
*/
PdfArray& operator=(const PdfArray& rhs);
/** /**
* \returns the size of the array * \returns the size of the array
*/ */
inline size_t GetSize() const; inline size_t GetSize() const;
/** Remove all elements from the array /** Remove all elements from the array
*/ */
inline void Clear(); inline void Clear();
/** Write the array to an output device. /** Write the array to an output device.
* This is an overloaded member function. * This is an overloaded member function.
* *
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
*/ */
void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt = NULL virtual void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode,
) const; const PdfEncrypt* pEncrypt = NULL ) const;
/** Utility method to determine if the array contains /** Utility method to determine if the array contains
* contains any objects of ePdfDataType_String whose * contains any objects of ePdfDataType_String whose
* value is the passed string. * value is the passed string.
* \param cmpString the string to compare against * \param cmpString the string to compare against
* \returns true if success, false if not * \returns true if success, false if not
*/ */
bool ContainsString( const std::string& cmpString ) const; bool ContainsString( const std::string& cmpString ) const;
/** Utility method to return the actual index in the /** Utility method to return the actual index in the
skipping to change at line 184 skipping to change at line 192
*/ */
inline reverse_iterator rend(); inline reverse_iterator rend();
/** /**
* Returns a read-only (constant) reverse iterator that points * Returns a read-only (constant) reverse iterator that points
* to one before the first element in the array. Iteration * to one before the first element in the array. Iteration
* is done in reverse element order. * is done in reverse element order.
*/ */
inline const_reverse_iterator rend() const; inline const_reverse_iterator rend() const;
#if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround templa te-error in Visualstudio 6 #if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround template-error in Visualstudio 6
inline void insert(iterator __position, inline void insert(iterator __position,
iterator __first, iterator __first,
iterator __last); iterator __last);
#else #else
template<typename _InputIterator> template<typename _InputIterator>
void insert(iterator __position, void insert(const iterator& __position,
_InputIterator __first, const _InputIterator& __first,
_InputIterator __last); const _InputIterator& __last);
#endif #endif
inline PdfArray::iterator insert(iterator __position, const PdfObject & val ); inline PdfArray::iterator insert(const iterator& __position, const PdfO bject & val );
inline void erase( iterator pos ); inline void erase( const iterator& pos );
inline void erase( iterator first, iterator last ); inline void erase( const iterator& first, const iterator& last );
inline void reserve(size_type __n); inline void reserve(size_type __n);
/** /**
* \returns a read/write reference to the data at the first * \returns a read/write reference to the data at the first
* element of the array. * element of the array.
*/ */
inline reference front(); inline reference front();
/** /**
skipping to change at line 387 skipping to change at line 395
// //
// ----------------------------------------------------- // -----------------------------------------------------
PdfArray::const_reverse_iterator PdfArray::rend() const PdfArray::const_reverse_iterator PdfArray::rend() const
{ {
return PdfArrayBaseClass::rend(); return PdfArrayBaseClass::rend();
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
#if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround templa te-error in Visualstudio 6 #if defined(_MSC_VER) && _MSC_VER <= 1200 // workaround template-e rror in Visualstudio 6
void PdfArray::insert(PdfArray::iterator __position, void PdfArray::insert(PdfArray::iterator __position,
PdfArray::iterator __first, PdfArray::iterator __first,
PdfArray::iterator __last) PdfArray::iterator __last)
#else #else
template<typename _InputIterator> template<typename _InputIterator>
void PdfArray::insert(PdfArray::iterator __position, void PdfArray::insert(const PdfArray::iterator& __position,
_InputIterator __first, const _InputIterator& __first,
_InputIterator __last) const _InputIterator& __last)
#endif #endif
{ {
AssertMutable(); AssertMutable();
PdfArrayBaseClass::insert( __position, __first, __last ); PdfArrayBaseClass::insert( __position, __first, __last );
m_bDirty = true; m_bDirty = true;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
PdfArray::iterator PdfArray::insert(PdfArray::iterator __position, const Pd fObject & val ) PdfArray::iterator PdfArray::insert(const iterator& __position, const PdfOb ject & val )
{ {
AssertMutable(); AssertMutable();
m_bDirty = true; m_bDirty = true;
return PdfArrayBaseClass::insert( __position, val ); return PdfArrayBaseClass::insert( __position, val );
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
void PdfArray::erase( iterator pos ) void PdfArray::erase( const iterator& pos )
{ {
AssertMutable(); AssertMutable();
PdfArrayBaseClass::erase( pos ); PdfArrayBaseClass::erase( pos );
m_bDirty = true; m_bDirty = true;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
void PdfArray::erase( iterator first, iterator last ) void PdfArray::erase( const iterator& first, const iterator& last )
{ {
AssertMutable(); AssertMutable();
PdfArrayBaseClass::erase( first, last ); PdfArrayBaseClass::erase( first, last );
m_bDirty = true; m_bDirty = true;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
skipping to change at line 482 skipping to change at line 490
const PdfObject & PdfArray::back() const const PdfObject & PdfArray::back() const
{ {
return PdfArrayBaseClass::back(); return PdfArrayBaseClass::back();
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfArray::operator==( const PdfArray & rhs ) const bool PdfArray::operator==( const PdfArray & rhs ) const
{ {
//TODO: This operator does not check for m_bDirty. Add comparison or ad d explanation why it should not be there
return (static_cast< PdfArrayBaseClass >(*this) == static_cast< PdfArra yBaseClass >(rhs) ); return (static_cast< PdfArrayBaseClass >(*this) == static_cast< PdfArra yBaseClass >(rhs) );
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfArray::operator!=( const PdfArray & rhs ) const bool PdfArray::operator!=( const PdfArray & rhs ) const
{ {
//TODO: This operator does not check for m_bDirty. Add comparison or ad d explanation why it should not be there
return (static_cast< PdfArrayBaseClass >(*this) != static_cast< PdfArra yBaseClass >(rhs) ); return (static_cast< PdfArrayBaseClass >(*this) != static_cast< PdfArra yBaseClass >(rhs) );
} }
typedef PdfArray TVariantList; typedef PdfArray TVariantList;
typedef PdfArray::iterator TIVariantList; typedef PdfArray::iterator TIVariantList;
typedef PdfArray::const_iterator TCIVariantList; typedef PdfArray::const_iterator TCIVariantList;
}; };
#endif // _PDF_ARRAY_H_ #endif // _PDF_ARRAY_H_
 End of changes. 16 change blocks. 
19 lines changed or deleted 28 lines changed or added


 PdfColor.h   PdfColor.h 
skipping to change at line 53 skipping to change at line 53
public: public:
/** Create a PdfColor object that is RGB black. /** Create a PdfColor object that is RGB black.
*/ */
PdfColor(); PdfColor();
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a grayscale value. * a grayscale value.
* *
* \param dGray a grayscalue value between 0.0 and 1.0 * \param dGray a grayscalue value between 0.0 and 1.0
*/ */
PdfColor( double dGray ); explicit PdfColor( double dGray );
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a RGB color * a RGB color
* *
* \param dRed the value of the red component, must be between 0.0 and 1.0 * \param dRed the value of the red component, must be between 0.0 and 1.0
* \param dGreen the value of the green component, must be between 0.0 and 1.0 * \param dGreen the value of the green component, must be between 0.0 and 1.0
* \param dBlue the value of the blue component, must be between 0.0 a nd 1.0 * \param dBlue the value of the blue component, must be between 0.0 a nd 1.0
*/ */
PdfColor( double dRed, double dGreen, double dBlue ); PdfColor( double dRed, double dGreen, double dBlue );
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a CMYK color * a CMYK color
* *
* \param dCyan the value of the cyan component, must be between 0.0 a nd 1.0 * \param dCyan the value of the cyan component, must be between 0.0 a nd 1.0
* \param dMagenta the value of the magenta component, must be between 0.0 and 1.0 * \param dMagenta the value of the magenta component, must be between 0.0 and 1.0
* \param dYellow the value of the yellow component, must be between 0 .0 and 1.0 * \param dYellow the value of the yellow component, must be between 0 .0 and 1.0
* \param dBlack the value of the black component, must be between 0.0 and 1.0 * \param dBlack the value of the black component, must be between 0.0 and 1.0
*/ */
PdfColor( double dCyan, double dMagenta, double dYellow, double dBlack ); PdfColor( double dCyan, double dMagenta, double dYellow, double dBlack );
/** Copy constructor /** Copy constructor
* *
* \param rhs copy rhs into this object * \param rhs copy rhs into this object
*/ */
inline PdfColor( const PdfColor & rhs ); PdfColor( const PdfColor & rhs );
/** Destructor
*/
virtual ~PdfColor();
/** Assignment operator /** Assignment operator
* *
* \param rhs copy rhs into this object * \param rhs copy rhs into this object
* *
* \returns a reference to this color object * \returns a reference to this color object
*/ */
const PdfColor & operator=( const PdfColor & rhs ); const PdfColor & operator=( const PdfColor & rhs );
/** Test for equality of colors. /** Test for equality of colors.
* *
* \param rhs color to compare ro * \param rhs color to compare ro
* *
* \returns true if object color is equal to rhs * \returns true if object color is equal to rhs
*/ */
inline bool operator==( const PdfColor & rhs ) const; inline bool operator==( const PdfColor & rhs ) const;
/** Test for inequality of colors. /** Test for inequality of colors.
* *
* \param rhs color to compare ro * \param rhs color to compare ro
* *
* \returns true if object color is not equal to rhs * \returns true if object color is not equal to rhs
*/ */
inline bool operator!=( const PdfColor & rhs ) const; inline bool operator!=( const PdfColor & rhs ) const;
/** Test if this is a grayscale color. /** Test if this is a grayscale color.
* *
* \returns true if this is a grayscale PdfColor object * \returns true if this is a grayscale PdfColor object
*/ */
inline bool IsGrayScale() const; inline bool IsGrayScale() const;
skipping to change at line 134 skipping to change at line 138
* \returns true if this is a separation PdfColor object * \returns true if this is a separation PdfColor object
*/ */
inline bool IsSeparation() const; inline bool IsSeparation() const;
/** Test if this is a CIE-Lab color. /** Test if this is a CIE-Lab color.
* *
* \returns true if this is a lab Color object * \returns true if this is a lab Color object
*/ */
inline bool IsCieLab() const; inline bool IsCieLab() const;
/** Get the colorspace of this PdfColor object /** Get the colorspace of this PdfColor object
* *
* \returns the colorspace of this PdfColor object * \returns the colorspace of this PdfColor object
*/ */
inline EPdfColorSpace GetColorSpace() const; inline EPdfColorSpace GetColorSpace() const;
/** Get the alternate colorspace of this PdfColor object /** Get the alternate colorspace of this PdfColor object
* *
* \returns the colorspace of this PdfColor object (must be separation ) * \returns the colorspace of this PdfColor object (must be separation )
*/ */
inline EPdfColorSpace GetAlternateColorSpace() const; inline EPdfColorSpace GetAlternateColorSpace() const;
/** Get the grayscale color value /** Get the grayscale color value
* of this object. * of this object.
* *
* Throws an exception if this is no grayscale color object. * Throws an exception if this is no grayscale color object.
* *
* \returns the grayscale color value of this object (between 0.0 and 1.0) * \returns the grayscale color value of this object (between 0.0 and 1.0)
* *
* \see IsGrayScale * \see IsGrayScale
*/ */
inline double GetGrayScale() const; inline double GetGrayScale() const;
skipping to change at line 242 skipping to change at line 246
inline double GetBlack() const; inline double GetBlack() const;
/** Get the separation name of this object. /** Get the separation name of this object.
* *
* Throws an exception if this is no separation color object. * Throws an exception if this is no separation color object.
* *
* \returns the name of this object * \returns the name of this object
* *
* \see IsSeparation * \see IsSeparation
*/ */
inline const std::string GetName() const; inline const std::string GetName() const;
/** Get the density color value /** Get the density color value
* of this object. * of this object.
* *
* Throws an exception if this is no separation color object. * Throws an exception if this is no separation color object.
* *
* \returns the density value of this object (between 0.0 and 1.0) * \returns the density value of this object (between 0.0 and 1.0)
* *
* \see IsSeparation * \see IsSeparation
*/ */
inline double GetDensity() const; inline double GetDensity() const;
/** Get the L color value /** Get the L color value
* of this object. * of this object.
* *
* Throws an exception if this is no CIE-Lab color object. * Throws an exception if this is no CIE-Lab color object.
* *
* \returns the L color value of this object (between 0.0 and 100.0) * \returns the L color value of this object (between 0.0 and 100.0)
* *
* \see IsCieLab * \see IsCieLab
*/ */
inline double GetCieL() const; inline double GetCieL() const;
skipping to change at line 288 skipping to change at line 292
* of this object. * of this object.
* *
* Throws an exception if this is no CIE-Lab color object. * Throws an exception if this is no CIE-Lab color object.
* *
* \returns the B color value of this object (between -128.0 and 127.0 ) * \returns the B color value of this object (between -128.0 and 127.0 )
* *
* \see IsCieLab * \see IsCieLab
*/ */
inline double GetCieB() const; inline double GetCieB() const;
/** Converts the color object into a grayscale /** Converts the color object into a grayscale
* color object. * color object.
* *
* This is only a convinience function. It might be useful * This is only a convinience function. It might be useful
* for on screen display but is in NO WAY suitable to * for on screen display but is in NO WAY suitable to
* professional printing! * professional printing!
* *
* \returns a grayscale color object * \returns a grayscale color object
* \see IsGrayScale() * \see IsGrayScale()
*/ */
PdfColor ConvertToGrayScale() const; PdfColor ConvertToGrayScale() const;
skipping to change at line 357 skipping to change at line 361
* \param rArray an array that must be a color PdfArray * \param rArray an array that must be a color PdfArray
* \returns a PdfColor object * \returns a PdfColor object
*/ */
static PdfColor FromArray( const PdfArray & rArray ); static PdfColor FromArray( const PdfArray & rArray );
/** Creates a colorspace object from a color to insert into resources. /** Creates a colorspace object from a color to insert into resources.
* *
* \param pOwner a pointer to the owner of the generated object * \param pOwner a pointer to the owner of the generated object
* \returns a PdfObject pointer, which can be insert into resources, N ULL if not needed * \returns a PdfObject pointer, which can be insert into resources, N ULL if not needed
*/ */
PdfObject* BuildColorSpace( PdfVecObjects* pOwner ) const; PdfObject* BuildColorSpace( PdfVecObjects* pOwner ) const;
protected: protected:
union { union {
double cmyk[4]; double cmyk[4];
double rgb[3]; double rgb[3];
double lab[3]; double lab[3];
double gray; double gray;
} m_uColor; } m_uColor;
std::string m_separationName; std::string m_separationName;
double m_separationDensity; double m_separationDensity;
EPdfColorSpace m_eColorSpace; EPdfColorSpace m_eColorSpace;
EPdfColorSpace m_eAlternateColorSpace; EPdfColorSpace m_eAlternateColorSpace;
private:
static const unsigned int* const m_hexDigitMap; ///< Mapping of hex seq
uences to int value
}; };
class PODOFO_API PdfColorGray : public PdfColor { class PODOFO_API PdfColorGray : public PdfColor {
public: public:
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a grayscale value. * a grayscale value.
* *
* \param dGray a grayscalue value between 0.0 and 1.0 * \param dGray a grayscalue value between 0.0 and 1.0
*/ */
PdfColorGray( double dGray ); explicit PdfColorGray( double dGray );
/** Class destructor.
*/
virtual ~PdfColorGray();
private:
/** Default constructor, not implemented
*/
PdfColorGray();
/** Copy constructor, not implemented
*/
PdfColorGray(const PdfColorGray& );
/** Copy assignment operator, not implemented
*/
PdfColorGray& operator=(const PdfColorGray&);
}; };
class PODOFO_API PdfColorRGB : public PdfColor { class PODOFO_API PdfColorRGB : public PdfColor {
public: public:
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a RGB color * a RGB color
* *
* \param dRed the value of the red component, must be between 0.0 and 1.0 * \param dRed the value of the red component, must be between 0.0 and 1.0
* \param dGreen the value of the green component, must be between 0.0 and 1.0 * \param dGreen the value of the green component, must be between 0.0 and 1.0
* \param dBlue the value of the blue component, must be between 0.0 a nd 1.0 * \param dBlue the value of the blue component, must be between 0.0 a nd 1.0
*/ */
PdfColorRGB( double dRed, double dGreen, double dBlue ); PdfColorRGB( double dRed, double dGreen, double dBlue );
/** Class destructor.
*/
virtual ~PdfColorRGB();
private:
/** Default constructor, not implemented
*/
PdfColorRGB();
/** Copy constructor, not implemented
*/
PdfColorRGB(const PdfColorRGB& );
/** Copy assignment operator, not implemented
*/
PdfColorRGB& operator=(const PdfColorRGB&);
}; };
class PODOFO_API PdfColorCMYK : public PdfColor { class PODOFO_API PdfColorCMYK : public PdfColor {
public: public:
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a CMYK color * a CMYK color
* *
* \param dCyan the value of the cyan component, must be between 0.0 a nd 1.0 * \param dCyan the value of the cyan component, must be between 0.0 a nd 1.0
* \param dMagenta the value of the magenta component, must be between 0.0 and 1.0 * \param dMagenta the value of the magenta component, must be between 0.0 and 1.0
* \param dYellow the value of the yellow component, must be between 0 .0 and 1.0 * \param dYellow the value of the yellow component, must be between 0 .0 and 1.0
* \param dBlack the value of the black component, must be between 0.0 and 1.0 * \param dBlack the value of the black component, must be between 0.0 and 1.0
*/ */
PdfColorCMYK( double dCyan, double dMagenta, double dYellow, double dBl ack ); PdfColorCMYK( double dCyan, double dMagenta, double dYellow, double dBl ack );
/** Class destructor.
*/
virtual ~PdfColorCMYK();
private:
/** Default constructor, not implemented
*/
PdfColorCMYK();
/** Copy constructor, not implemented
*/
PdfColorCMYK(const PdfColorCMYK& );
/** Copy assignment operator, not implemented
*/
PdfColorCMYK& operator=(const PdfColorCMYK&);
}; };
class PODOFO_API PdfColorSeparationAll : public PdfColor { class PODOFO_API PdfColorSeparationAll : public PdfColor {
public: public:
/** Create a new PdfColor object with /** Create a new PdfColor object with
* Separation color All. * Separation color All.
* *
*/ */
PdfColorSeparationAll(); PdfColorSeparationAll();
/** Class destructor.
*/
virtual ~PdfColorSeparationAll();
private:
/** Copy constructor, not implemented
*/
PdfColorSeparationAll(const PdfColorSeparationAll& );
/** Copy assignment operator, not implemented
*/
PdfColorSeparationAll& operator=(const PdfColorSeparationAll&);
}; };
class PODOFO_API PdfColorSeparationNone : public PdfColor { class PODOFO_API PdfColorSeparationNone : public PdfColor {
public: public:
/** Create a new PdfColor object with /** Create a new PdfColor object with
* Separation color None. * Separation color None.
* *
*/ */
PdfColorSeparationNone(); PdfColorSeparationNone();
/** Class destructor.
*/
virtual ~PdfColorSeparationNone();
private:
/** Copy constructor, not implemented
*/
PdfColorSeparationNone(const PdfColorSeparationNone& );
/** Copy assignment operator, not implemented
*/
PdfColorSeparationNone& operator=(const PdfColorSeparationNone&);
}; };
class PODOFO_API PdfColorSeparation : public PdfColor { class PODOFO_API PdfColorSeparation : public PdfColor {
public: public:
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a separation-name and an equivalent color * a separation-name and an equivalent color
* *
* \param sName Name of the separation color * \param sName Name of the separation color
* \param sDensity the density value of the separation color * \param sDensity the density value of the separation color
* \param alternateColor the alternate color, must be of typ gray, rgb , cmyk or cie * \param alternateColor the alternate color, must be of typ gray, rgb , cmyk or cie
*/ */
PdfColorSeparation( const std::string & sName, double dDensity, cons PdfColorSeparation( const std::string & sName, double dDensity, const P
t PdfColor & alternateColor ); dfColor & alternateColor );
/** Class destructor.
*/
virtual ~PdfColorSeparation();
private:
/** Default constructor, not implemented
*/
PdfColorSeparation();
/** Copy constructor, not implemented
*/
PdfColorSeparation(const PdfColorSeparation& );
/** Copy assignment operator, not implemented
*/
PdfColorSeparation& operator=(const PdfColorSeparation&);
}; };
class PODOFO_API PdfColorCieLab : public PdfColor { class PODOFO_API PdfColorCieLab : public PdfColor {
public: public:
/** Create a new PdfColor object with /** Create a new PdfColor object with
* a CIE-LAB-values * a CIE-LAB-values
* *
* \param dCieL the value of the L component, must be between 0.0 and 100.0 * \param dCieL the value of the L component, must be between 0.0 and 100.0
* \param dCieA the value of the A component, must be between -128.0 a nd 127.0 * \param dCieA the value of the A component, must be between -128.0 a nd 127.0
* \param dCieB the value of the B component, must be between -128.0 a nd 127.0 * \param dCieB the value of the B component, must be between -128.0 a nd 127.0
*/ */
PdfColorCieLab( double dCieL, double dCieA, double dCieB ); PdfColorCieLab( double dCieL, double dCieA, double dCieB );
};
// ----------------------------------------------------- /** Class destructor.
// */
// ----------------------------------------------------- virtual ~PdfColorCieLab();
PdfColor::PdfColor( const PdfColor & rhs )
{ private:
this->operator=( rhs ); /** Default constructor, not implemented
} */
PdfColorCieLab();
/** Copy constructor, not implemented
*/
PdfColorCieLab(const PdfColorCieLab& );
/** Copy assignment operator, not implemented
*/
PdfColorCieLab& operator=(const PdfColorCieLab&);
};
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
inline bool PdfColor::operator==( const PdfColor & rhs ) const inline bool PdfColor::operator==( const PdfColor & rhs ) const
{ {
if ( m_eColorSpace == rhs.m_eColorSpace ) if ( m_eColorSpace == rhs.m_eColorSpace )
{ {
if ( if (
m_eColorSpace == ePdfColorSpace_DeviceGray (m_eColorSpace == ePdfColorSpace_DeviceGray) &&
&& (m_uColor.gray == rhs.m_uColor.gray)
m_uColor.gray == rhs.m_uColor.gray )
) return true;
return true;
if (
if ( (m_eColorSpace == ePdfColorSpace_DeviceRGB) &&
m_eColorSpace == ePdfColorSpace_DeviceRGB (m_uColor.rgb[0] == rhs.m_uColor.rgb[0]) &&
&& (m_uColor.rgb[1] == rhs.m_uColor.rgb[1]) &&
m_uColor.rgb[0] == rhs.m_uColor.rgb[0] (m_uColor.rgb[2] == rhs.m_uColor.rgb[2])
&& )
m_uColor.rgb[1] == rhs.m_uColor.rgb[1] return true;
&&
m_uColor.rgb[2] == rhs.m_uColor.rgb[2] if (
) (m_eColorSpace == ePdfColorSpace_DeviceCMYK) &&
return true; (m_uColor.cmyk[0] == rhs.m_uColor.cmyk[0]) &&
(m_uColor.cmyk[1] == rhs.m_uColor.cmyk[1]) &&
if ( (m_uColor.cmyk[2] == rhs.m_uColor.cmyk[2]) &&
m_eColorSpace == ePdfColorSpace_DeviceCMYK (m_uColor.cmyk[3] == rhs.m_uColor.cmyk[3])
&& )
m_uColor.cmyk[0] == rhs.m_uColor.cmyk[0] return true;
&&
m_uColor.cmyk[1] == rhs.m_uColor.cmyk[1] if (
&& (m_eColorSpace == ePdfColorSpace_CieLab) &&
m_uColor.cmyk[2] == rhs.m_uColor.cmyk[2] (m_uColor.lab[0] == rhs.m_uColor.lab[0]) &&
&& (m_uColor.lab[1] == rhs.m_uColor.lab[1]) &&
m_uColor.cmyk[3] == rhs.m_uColor.cmyk[3] (m_uColor.lab[2] == rhs.m_uColor.lab[2])
) )
return true; return true;
if ( if (
m_eColorSpace == ePdfColorSpace_CieLab (m_eColorSpace == ePdfColorSpace_Separation) &&
&& (m_separationDensity == rhs.m_separationDensity) &&
m_uColor.lab[0] == rhs.m_uColor.lab[0] (m_separationName == rhs.m_separationName) &&
&& (m_eAlternateColorSpace == rhs.m_eAlternateColorSpace) &&
m_uColor.lab[1] == rhs.m_uColor.lab[1] (
&& (
m_uColor.lab[2] == rhs.m_uColor.lab[2] (m_eAlternateColorSpace == ePdfColorSpace_DeviceGray) &&
) (m_uColor.gray == rhs.m_uColor.gray)
return true; ) ||
(
if ( (m_eAlternateColorSpace == ePdfColorSpace_DeviceRGB) &&
m_eColorSpace == ePdfColorSpace_Separation (m_uColor.rgb[0] == rhs.m_uColor.rgb[0]) &&
&& (m_uColor.rgb[1] == rhs.m_uColor.rgb[1]) &&
m_separationDensity == rhs.m_separationDensity (m_uColor.rgb[2] == rhs.m_uColor.rgb[2])
&& ) ||
m_separationName == rhs.m_separationName (
&& (m_eAlternateColorSpace == ePdfColorSpace_DeviceCMYK) &&
m_eAlternateColorSpace == rhs.m_eAlternateColorSpace (m_uColor.cmyk[0] == rhs.m_uColor.cmyk[0]) &&
&& (m_uColor.cmyk[1] == rhs.m_uColor.cmyk[1]) &&
( (m_uColor.cmyk[2] == rhs.m_uColor.cmyk[2]) &&
( (m_uColor.cmyk[3] == rhs.m_uColor.cmyk[3])
m_eAlternateColorSpace == ePdfColorSpace_DeviceGra ) ||
y && (
m_uColor.gray == rhs.m_uColor.gray (m_eAlternateColorSpace == ePdfColorSpace_CieLab) &&
) (m_uColor.lab[0] == rhs.m_uColor.lab[0]) &&
|| (m_uColor.lab[1] == rhs.m_uColor.lab[1]) &&
( (m_uColor.lab[2] == rhs.m_uColor.lab[2])
m_eAlternateColorSpace == ePdfColorSpace_DeviceRGB )
&& )
m_uColor.rgb[0] == rhs.m_uColor.rgb[0] )
&& return true;
m_uColor.rgb[1] == rhs.m_uColor.rgb[1]
&&
m_uColor.rgb[2] == rhs.m_uColor.rgb[2]
)
||
(
m_eAlternateColorSpace == ePdfColorSpace_DeviceCMY
K &&
m_uColor.cmyk[0] == rhs.m_uColor.cmyk[0]
&&
m_uColor.cmyk[1] == rhs.m_uColor.cmyk[1]
&&
m_uColor.cmyk[2] == rhs.m_uColor.cmyk[2]
&&
m_uColor.cmyk[3] == rhs.m_uColor.cmyk[3]
)
||
(
m_eAlternateColorSpace == ePdfColorSpace_CieLab
&&
m_uColor.lab[0] == rhs.m_uColor.lab[0]
&&
m_uColor.lab[1] == rhs.m_uColor.lab[1]
&&
m_uColor.lab[2] == rhs.m_uColor.lab[2]
)
)
)
return true;
} }
return false; return false;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
inline bool PdfColor::operator!=( const PdfColor & rhs ) const inline bool PdfColor::operator!=( const PdfColor & rhs ) const
{ {
return ! (*this == rhs); return ! (*this == rhs);
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfColor::IsGrayScale() const bool PdfColor::IsGrayScale() const
{ {
return (m_eColorSpace == ePdfColorSpace_DeviceGray); return (m_eColorSpace == ePdfColorSpace_DeviceGray);
} }
skipping to change at line 608 skipping to change at line 718
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsSeparation(), "PdfColor::GetAlternateCo lorSpace cannot be called on non separation color objects!"); PODOFO_RAISE_LOGIC_IF( !this->IsSeparation(), "PdfColor::GetAlternateCo lorSpace cannot be called on non separation color objects!");
return m_eAlternateColorSpace; return m_eAlternateColorSpace;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetGrayScale() const double PdfColor::GetGrayScale() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsGrayScale() && PODOFO_RAISE_LOGIC_IF( !this->IsGrayScale() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceGray), orSpace == ePdfColorSpace_DeviceGray)),
"PdfColor::GetGrayScale c "PdfColor::GetGrayScale cannot be called on non
annot be called on non grayscale color objects!"); grayscale color objects!");
return m_uColor.gray; return m_uColor.gray;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetRed() const double PdfColor::GetRed() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsRGB() && PODOFO_RAISE_LOGIC_IF( !this->IsRGB() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceRGB), orSpace == ePdfColorSpace_DeviceRGB)),
"PdfColor::GetRed cannot "PdfColor::GetRed cannot be called on non RGB co
be called on non RGB color objects!"); lor objects!");
return m_uColor.rgb[0]; return m_uColor.rgb[0];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetGreen() const double PdfColor::GetGreen() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsRGB() && PODOFO_RAISE_LOGIC_IF( !this->IsRGB() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceRGB), orSpace == ePdfColorSpace_DeviceRGB)),
"PdfColor::GetGreen canno "PdfColor::GetGreen cannot be called on non RGB
t be called on non RGB color objects!"); color objects!");
return m_uColor.rgb[1]; return m_uColor.rgb[1];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetBlue() const double PdfColor::GetBlue() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsRGB() && PODOFO_RAISE_LOGIC_IF( !this->IsRGB() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceRGB), orSpace == ePdfColorSpace_DeviceRGB)),
"PdfColor::GetBlue cannot "PdfColor::GetBlue cannot be called on non RGB c
be called on non RGB color objects!"); olor objects!");
return m_uColor.rgb[2]; return m_uColor.rgb[2];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetCyan() const double PdfColor::GetCyan() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() && PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceCMYK), orSpace == ePdfColorSpace_DeviceCMYK)),
"PdfColor::GetCyan cannot "PdfColor::GetCyan cannot be called on non CMYK
be called on non CMYK color objects!"); color objects!");
return m_uColor.cmyk[0]; return m_uColor.cmyk[0];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetMagenta() const double PdfColor::GetMagenta() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() && PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceCMYK), orSpace == ePdfColorSpace_DeviceCMYK)),
"PdfColor::GetMagenta can "PdfColor::GetMagenta cannot be called on non CM
not be called on non CMYK color objects!"); YK color objects!");
return m_uColor.cmyk[1]; return m_uColor.cmyk[1];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetYellow() const double PdfColor::GetYellow() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() && PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceCMYK), orSpace == ePdfColorSpace_DeviceCMYK)),
"PdfColor::GetYellow cann "PdfColor::GetYellow cannot be called on non CMY
ot be called on non CMYK color objects!"); K color objects!");
return m_uColor.cmyk[2]; return m_uColor.cmyk[2];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetBlack() const double PdfColor::GetBlack() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() && PODOFO_RAISE_LOGIC_IF( !this->IsCMYK() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_DeviceCMYK), orSpace == ePdfColorSpace_DeviceCMYK)),
"PdfColor::GetBlack canno "PdfColor::GetBlack cannot be called on non CMYK
t be called on non CMYK color objects!"); color objects!");
return m_uColor.cmyk[3]; return m_uColor.cmyk[3];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
const std::string PdfColor::GetName() const const std::string PdfColor::GetName() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsSeparation(), "PdfColor::GetName cannot be called on non separation color objects!"); PODOFO_RAISE_LOGIC_IF( !this->IsSeparation(), "PdfColor::GetName cannot be called on non separation color objects!");
skipping to change at line 725 skipping to change at line 835
return m_separationDensity; return m_separationDensity;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetCieL() const double PdfColor::GetCieL() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsCieLab() && PODOFO_RAISE_LOGIC_IF( !this->IsCieLab() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_CieLab), orSpace == ePdfColorSpace_CieLab)),
"PdfColor::GetCieL cannot "PdfColor::GetCieL cannot be called on non CIE-L
be called on non CIE-Lab color objects!"); ab color objects!");
return m_uColor.lab[0]; return m_uColor.lab[0];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetCieA() const double PdfColor::GetCieA() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsCieLab() && PODOFO_RAISE_LOGIC_IF( !this->IsCieLab() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_CieLab), orSpace == ePdfColorSpace_CieLab)),
"PdfColor::GetCieA cannot "PdfColor::GetCieA cannot be called on non CIE-L
be called on non CIE-Lab color objects!"); ab color objects!");
return m_uColor.lab[1]; return m_uColor.lab[1];
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
double PdfColor::GetCieB() const double PdfColor::GetCieB() const
{ {
PODOFO_RAISE_LOGIC_IF( !this->IsCieLab() && PODOFO_RAISE_LOGIC_IF( !this->IsCieLab() &&
!(this->IsSeparation() && !(this->IsSeparation() && (this->m_eAlternateCol
this->m_eAlternateColorSpace == ePdfColorSpace_CieLab), orSpace == ePdfColorSpace_CieLab)),
"PdfColor::GetCieB cannot "PdfColor::GetCieB cannot be called on non CIE-L
be called on non CIE-Lab color objects!"); ab color objects!");
return m_uColor.lab[2]; return m_uColor.lab[2];
} }
}; };
#endif // _PDF_COLOR_H_ #endif // _PDF_COLOR_H_
 End of changes. 41 change blocks. 
177 lines changed or deleted 259 lines changed or added


 PdfCompilerCompat.h   PdfCompilerCompat.h 
skipping to change at line 75 skipping to change at line 75
#if PODOFO_HAVE_STRINGS_H #if PODOFO_HAVE_STRINGS_H
#include <strings.h> #include <strings.h>
#endif #endif
// alloca() is defined only in <cstdlib> on Mac OS X, // alloca() is defined only in <cstdlib> on Mac OS X,
// only in <malloc.h> on win32, and in both on Linux. // only in <malloc.h> on win32, and in both on Linux.
#if defined(_WIN32) #if defined(_WIN32)
#include <malloc.h> #include <malloc.h>
#endif #endif
// Disable usage of min() and max() macros
#if defined(_WIN32)
#define NOMINMAX
#endif
// Integer types - fixed size types guaranteed to work anywhere // Integer types - fixed size types guaranteed to work anywhere
// because we detect the right underlying type name to use with // because we detect the right underlying type name to use with
// CMake. Use typedefs rather than macros for saner error messages // CMake. Use typedefs rather than macros for saner error messages
// etc. // etc.
namespace PoDoFo { namespace PoDoFo {
typedef PDF_INT8_TYPENAME pdf_int8; typedef PDF_INT8_TYPENAME pdf_int8;
typedef PDF_INT16_TYPENAME pdf_int16; typedef PDF_INT16_TYPENAME pdf_int16;
typedef PDF_INT32_TYPENAME pdf_int32; typedef PDF_INT32_TYPENAME pdf_int32;
typedef PDF_INT64_TYPENAME pdf_int64; typedef PDF_INT64_TYPENAME pdf_int64;
typedef PDF_UINT8_TYPENAME pdf_uint8; typedef PDF_UINT8_TYPENAME pdf_uint8;
 End of changes. 1 change blocks. 
0 lines changed or deleted 5 lines changed or added


 PdfData.h   PdfData.h 
skipping to change at line 78 skipping to change at line 78
* \param rhs another PdfData to copy * \param rhs another PdfData to copy
*/ */
PdfData( const PdfData & rhs ) PdfData( const PdfData & rhs )
: PdfDataType() : PdfDataType()
{ {
this->operator=( rhs ); this->operator=( rhs );
} }
/** Write the complete datatype to a file. /** Write the complete datatype to a file.
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
*
* PdfData cannot do any encryption for you. So the encryption object w
ill
* be ignored as it is also the case for the write mode!
*/ */
void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt = NULL ) const; void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, const P dfEncrypt* pEncrypt = NULL ) const;
/** Copy an existing PdfData /** Copy an existing PdfData
* \param rhs another PdfData to copy * \param rhs another PdfData to copy
* \returns this object * \returns this object
*/ */
inline const PdfData & operator=( const PdfData & rhs ); inline const PdfData & operator=( const PdfData & rhs );
/** /**
* Access the data as a std::string * Access the data as a std::string
* \returns a const reference to the contained data * \returns a const reference to the contained data
 End of changes. 2 change blocks. 
1 lines changed or deleted 6 lines changed or added


 PdfDataType.h   PdfDataType.h 
skipping to change at line 50 skipping to change at line 50
/** Create a new PdfDataType. /** Create a new PdfDataType.
* Can only be called by subclasses * Can only be called by subclasses
*/ */
PdfDataType(); PdfDataType();
public: public:
virtual ~PdfDataType(); virtual ~PdfDataType();
/** Write the complete datatype to a file. /** Write the complete datatype to a file.
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
*/ */
virtual void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncryp t = NULL ) const = 0; virtual void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, const PdfEncrypt* pEncrypt = NULL ) const = 0;
/** The dirty flag is set if this variant /** The dirty flag is set if this variant
* has been modified after construction. * has been modified after construction.
* *
* Usually the dirty flag is also set * Usually the dirty flag is also set
* if you call any non-const member function * if you call any non-const member function
* as we cannot determine if you actually changed * as we cannot determine if you actually changed
* something or not. * something or not.
* *
* \returns true if the value is dirty and has been * \returns true if the value is dirty and has been
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 PdfDefines.h   PdfDefines.h 
skipping to change at line 158 skipping to change at line 158
ePdfVersion_1_6, /**< PDF 1.6 */ ePdfVersion_1_6, /**< PDF 1.6 */
ePdfVersion_1_7 /**< PDF 1.7 */ ePdfVersion_1_7 /**< PDF 1.7 */
}; };
/** The default PDF Version used by new PDF documents /** The default PDF Version used by new PDF documents
* in PoDoFo. * in PoDoFo.
*/ */
const EPdfVersion ePdfVersion_Default = ePdfVersion_1_3; const EPdfVersion ePdfVersion_Default = ePdfVersion_1_3;
/** /**
* Specify additional options for writing the PDF.
*/
enum EPdfWriteMode {
ePdfWriteMode_Compact = 0x01, ///< Try to write the PDF as compact as p
ossible (Default)
ePdfWriteMode_Clean = 0x02, ///< Create a PDF that is readable in a t
ext editor, i.e. insert spaces and linebreaks between tokens
};
const EPdfWriteMode ePdfWriteMode_Default = ePdfWriteMode_Compact;
/**
* Every PDF datatype that can occur in a PDF file * Every PDF datatype that can occur in a PDF file
* is referenced by an own enum (e.g. Bool or String). * is referenced by an own enum (e.g. Bool or String).
* *
* \see PdfVariant * \see PdfVariant
* *
* Remember to update PdfVariant::GetDataTypeString() when adding members h ere. * Remember to update PdfVariant::GetDataTypeString() when adding members h ere.
*/ */
enum EPdfDataType { enum EPdfDataType {
ePdfDataType_Bool, /**< Boolean datatype: Accepts the values "true" and "false" */ ePdfDataType_Bool, /**< Boolean datatype: Accepts the values "true" and "false" */
ePdfDataType_Number, /**< Number datatype for integer va lues */ ePdfDataType_Number, /**< Number datatype for integer va lues */
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added


 PdfDictionary.h   PdfDictionary.h 
skipping to change at line 198 skipping to change at line 198
* there was is no key with this name, false is returned. * there was is no key with this name, false is returned.
* *
* This will set the dirty flag of this object. * This will set the dirty flag of this object.
* \see IsDirty * \see IsDirty
*/ */
bool RemoveKey( const PdfName & identifier ); bool RemoveKey( const PdfName & identifier );
/** Write the complete dictionary to a file. \param pDevice write the /** Write the complete dictionary to a file. \param pDevice write the
* object to this device \returns ErrOk on success * object to this device \returns ErrOk on success
* *
* \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
*/ */
inline void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt = NULL ) const; inline void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, const PdfEncrypt* pEncrypt = NULL ) const;
/** Write the complete dictionary to a file. \param pDevice write the /** Write the complete dictionary to a file. \param pDevice write the
* object to this device \param keyStop if not KeyNull and a key == key Stop * object to this device \param keyStop if not KeyNull and a key == key Stop
* is found writing will stop right before this key! \returns ErrOk on * is found writing will stop right before this key! \returns ErrOk on
* success * success
* *
* \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
* \param keyStop if not KeyNull and a key == keyStop is found
* writing will stop right before this key!
*/ */
void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt, const void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode,
PdfName & keyStop = const PdfEncrypt* pEncrypt, const PdfName & keyStop = PdfNa
PdfName::KeyNull ) const; me::KeyNull ) const;
/** Get access to the internal map of keys. /** Get access to the internal map of keys.
* *
* \returns all keys of this dictionary * \returns all keys of this dictionary
*/ */
inline const TKeyMap & GetKeys() const; inline const TKeyMap & GetKeys() const;
/** Get access to the internal map of keys. \returns all keys of this /** Get access to the internal map of keys. \returns all keys of this
* dictionary * dictionary
*/ */
skipping to change at line 276 skipping to change at line 282
// //
// ----------------------------------------------------- // -----------------------------------------------------
TKeyMap & PdfDictionary::GetKeys() TKeyMap & PdfDictionary::GetKeys()
{ {
return m_mapKeys; return m_mapKeys;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
void PdfDictionary::Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEnc rypt ) const void PdfDictionary::Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMo de, const PdfEncrypt* pEncrypt ) const
{ {
this->Write( pDevice, pEncrypt, PdfName::KeyNull ); this->Write( pDevice, eWriteMode, pEncrypt, PdfName::KeyNull );
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfDictionary::operator!=( const PdfDictionary& rhs ) const bool PdfDictionary::operator!=( const PdfDictionary& rhs ) const
{ {
return !(*this == rhs); return !(*this == rhs);
} }
 End of changes. 7 change blocks. 
6 lines changed or deleted 12 lines changed or added


 PdfDocument.h   PdfDocument.h 
skipping to change at line 71 skipping to change at line 71
*/ */
class PODOFO_API PdfDocument { class PODOFO_API PdfDocument {
friend class PdfWriter; friend class PdfWriter;
friend class PdfElement; friend class PdfElement;
public: public:
/** Close down/destruct the PdfDocument /** Close down/destruct the PdfDocument
*/ */
virtual ~PdfDocument(); virtual ~PdfDocument();
/** Get the write mode used for wirting the PDF
* \returns the write mode
*/
virtual EPdfWriteMode GetWriteMode() const = 0;
/** Get the PDF version of the document /** Get the PDF version of the document
* \returns EPdfVersion version of the pdf document * \returns EPdfVersion version of the pdf document
*/ */
virtual EPdfVersion GetPdfVersion() const = 0; virtual EPdfVersion GetPdfVersion() const = 0;
/** Returns wether this PDF document is linearized, aka /** Returns wether this PDF document is linearized, aka
* weboptimized * weboptimized
* \returns true if the PDF document is linearized * \returns true if the PDF document is linearized
*/ */
virtual bool IsLinearized() const = 0; virtual bool IsLinearized() const = 0;
skipping to change at line 143 skipping to change at line 148
* *
* \param nIndex which page (0-based) * \param nIndex which page (0-based)
* \returns a pointer to a PdfPage for the requested page. * \returns a pointer to a PdfPage for the requested page.
* The returned object is owned by the PdfDocument. * The returned object is owned by the PdfDocument.
*/ */
PdfPage* GetPage( int nIndex ) const; PdfPage* GetPage( int nIndex ) const;
/** Creates a PdfFont object /** Creates a PdfFont object
* \param pszFontName name of the font as it is known to the system * \param pszFontName name of the font as it is known to the system
* \param pEncoding the encoding of the font. The font will not take o wnership of this object. * \param pEncoding the encoding of the font. The font will not take o wnership of this object.
* \param eFontCreationFlags special flag to specify how fonts should be created
* \param bEmbedd specifies whether this font should be embedded in th e PDF file. * \param bEmbedd specifies whether this font should be embedded in th e PDF file.
* Embedding fonts is usually a good idea. * Embedding fonts is usually a good idea.
* *
* \returns PdfFont* a pointer to a new PdfFont object. * \returns PdfFont* a pointer to a new PdfFont object.
* The returned object is owned by the PdfDocument. * The returned object is owned by the PdfDocument.
*/ */
PdfFont* CreateFont( const char* pszFontName, const PdfEncoding * const PdfFont* CreateFont( const char* pszFontName,
pEncoding = PdfEncodingFactory::GlobalWinAnsiEncodingInstance(), const PdfEncoding * const pEncoding = PdfEncodingF
actory::GlobalWinAnsiEncodingInstance(),
PdfFontCache::EFontCreationFlags eFontCreationFlag
s = PdfFontCache::eFontCreationFlags_AutoSelectBase14,
bool bEmbedd = true ); bool bEmbedd = true );
/** Creates a PdfFont object /** Creates a PdfFont object
* \param pszFontName name of the font as it is known to the system * \param pszFontName name of the font as it is known to the system
* \param bBold if true search for a bold font * \param bBold if true search for a bold font
* \param bItalic if true search for an italic font * \param bItalic if true search for an italic font
* \param pEncoding the encoding of the font. The font will not take o wnership of this object. * \param pEncoding the encoding of the font. The font will not take o wnership of this object.
* \param eFontCreationFlags special flag to specify how fonts should be created
* \param bEmbedd specifies whether this font should be embedded in th e PDF file. * \param bEmbedd specifies whether this font should be embedded in th e PDF file.
* Embedding fonts is usually a good idea. * Embedding fonts is usually a good idea.
* \param optional: pszFileName path to a valid font file * \param optional: pszFileName path to a valid font file
* *
* \returns PdfFont* a pointer to a new PdfFont object. * \returns PdfFont* a pointer to a new PdfFont object.
*/ */
PdfFont* CreateFont( const char* pszFontName, bool bBold, bool bItalic, PdfFont* CreateFont( const char* pszFontName, bool bBold, bool bItalic,
const PdfEncoding * const pEncoding = PdfEncodingF actory::GlobalWinAnsiEncodingInstance(), const PdfEncoding * const pEncoding = PdfEncodingF actory::GlobalWinAnsiEncodingInstance(),
PdfFontCache::EFontCreationFlags eFontCreationFlag s = PdfFontCache::eFontCreationFlags_AutoSelectBase14,
bool bEmbedd = true, const char* pszFileName = NUL L ); bool bEmbedd = true, const char* pszFileName = NUL L );
#ifdef _WIN32 #ifdef _WIN32
/** Creates a PdfFont object /** Creates a PdfFont object
* \param pszFontName name of the font as it is known to the system * \param pszFontName name of the font as it is known to the system
* \param pEncoding the encoding of the font. The font will not take o wnership of this object. * \param pEncoding the encoding of the font. The font will not take o wnership of this object.
* \param bEmbedd specifies whether this font should be embedded in th e PDF file. * \param bEmbedd specifies whether this font should be embedded in th e PDF file.
* Embedding fonts is usually a good idea. * Embedding fonts is usually a good idea.
* *
* \returns PdfFont* a pointer to a new PdfFont object. * \returns PdfFont* a pointer to a new PdfFont object.
skipping to change at line 266 skipping to change at line 276
const PdfEncoding * const = PdfEncodingFactor y::GlobalWinAnsiEncodingInstance() ); const PdfEncoding * const = PdfEncodingFactor y::GlobalWinAnsiEncodingInstance() );
#endif // _WIN32 #endif // _WIN32
// Peter Petrov 26 April 2008 // Peter Petrov 26 April 2008
/** Returns the font library from font cache /** Returns the font library from font cache
* *
* \returns the internal handle to the freetype library * \returns the internal handle to the freetype library
*/ */
inline FT_Library GetFontLibrary() const; inline FT_Library GetFontLibrary() const;
/** Embeds all pending subset-fonts, is automatically done on Write().
* Just call explicit in case PdfDocument is needed as XObject
*
*/
void EmbedSubsetFonts();
/** Creates a new page object and inserts it into the internal /** Creates a new page object and inserts it into the internal
* page tree. * page tree.
* The returned page is owned by the PdfDocument * The returned page is owned by the PdfDocument
* and will get deleted along with it! * and will get deleted along with it!
* *
* \param rSize a PdfRect spezifying the size of the page (i.e the /Me diaBox key) in 1/1000th mm * \param rSize a PdfRect spezifying the size of the page (i.e the /Me diaBox key) in 1/1000th mm
* \returns a pointer to a PdfPage object * \returns a pointer to a PdfPage object
*/ */
PdfPage* CreatePage( const PdfRect & rSize ); PdfPage* CreatePage( const PdfRect & rSize );
skipping to change at line 287 skipping to change at line 303
* \param rDoc the document to append * \param rDoc the document to append
* \param bAppendAll specifies whether pages and outlines are appended too * \param bAppendAll specifies whether pages and outlines are appended too
* \returns this document * \returns this document
*/ */
const PdfDocument & Append( const PdfMemDocument & rDoc, bool bAppendAl l = true ); const PdfDocument & Append( const PdfMemDocument & rDoc, bool bAppendAl l = true );
/** Fill an existing empty XObject from a page of another document /** Fill an existing empty XObject from a page of another document
* \param pXObj pointer to the XOject * \param pXObj pointer to the XOject
* \param rDoc the document to embedd into XObject * \param rDoc the document to embedd into XObject
* \param nPage page-number to embedd into XObject * \param nPage page-number to embedd into XObject
* \param bUseTrimBox if true try to use trimbox for size of xo bject
* \returns the bounding box * \returns the bounding box
*/ */
PdfRect FillXObjectFromDocumentPage( PdfXObject * pXObj, const PdfMemDo cument & rDoc, int nPage ); PdfRect FillXObjectFromDocumentPage( PdfXObject * pXObj, const PdfMemDo cument & rDoc, int nPage, bool bUseTrimBox );
/** Attach a file to the document. /** Attach a file to the document.
* \param rFileSpec a file specification * \param rFileSpec a file specification
*/ */
void AttachFile( const PdfFileSpec & rFileSpec ); void AttachFile( const PdfFileSpec & rFileSpec );
/** Adds a PdfDestination into the global Names tree /** Adds a PdfDestination into the global Names tree
* with the specified name, optionally replacing one of the same name * with the specified name, optionally replacing one of the same name
* \param rDest the destination to be assigned * \param rDest the destination to be assigned
* \param rsName the name for the destination * \param rsName the name for the destination
 End of changes. 8 change blocks. 
3 lines changed or deleted 21 lines changed or added


 PdfEncrypt.h   PdfEncrypt.h 
skipping to change at line 235 skipping to change at line 235
/** /**
* Tries to authenticate a user using either the user or owner password * Tries to authenticate a user using either the user or owner password
* *
* \param password owner or user password * \param password owner or user password
* \param documentId the documentId of the PDF file * \param documentId the documentId of the PDF file
* *
* \returns true if either the owner or user password matches password * \returns true if either the owner or user password matches password
*/ */
bool Authenticate( const std::string & password, const PdfString & docu mentId ); bool Authenticate( const std::string & password, const PdfString & docu mentId );
/** Get the encryption algorithm of this object.
* \returns the EPdfEncryptAlgorithm of this object
*/
inline EPdfEncryptAlgorithm GetEncryptAlgorithm() const;
/** Checks if printing this document is allowed. /** Checks if printing this document is allowed.
* Every PDF consuming applications has to adhere this value! * Every PDF consuming applications has to adhere this value!
* *
* \returns true if you are allowed to print this document * \returns true if you are allowed to print this document
* *
* \see PdfEncrypt to set own document permissions. * \see PdfEncrypt to set own document permissions.
*/ */
inline bool IsPrintAllowed() const; inline bool IsPrintAllowed() const;
/** Checks if modifiying this document (besides annotations, form field s or changing pages) is allowed. /** Checks if modifiying this document (besides annotations, form field s or changing pages) is allowed.
skipping to change at line 311 skipping to change at line 316
* \returns true if you are allowed to print a high quality version of this document * \returns true if you are allowed to print a high quality version of this document
* *
* \see PdfEncrypt to set own document permissions. * \see PdfEncrypt to set own document permissions.
*/ */
inline bool IsHighPrintAllowed() const; inline bool IsHighPrintAllowed() const;
bool Authenticate(const std::string & documentID, const std::string & p assword, bool Authenticate(const std::string & documentID, const std::string & p assword,
const std::string & uValue, const std::string & oValu e, const std::string & uValue, const std::string & oValu e,
int pValue, int lengthValue, int rValue); int pValue, int lengthValue, int rValue);
/// Get the U object value (user) /// Get the U object value (user)
const unsigned char* GetUValue() const { return m_uValue; } const unsigned char* GetUValue() const { return m_uValue; }
/// Get the O object value (owner)
const unsigned char* GetOValue() const { return m_oValue; }
/// Get the P object value (protection)
int GetPValue() const { return m_pValue; }
/// Get the revision number of the encryption method
int GetRevision() const { return m_rValue; }
/// Get the key length of the encryption key in bits
int GetKeyLength() const { return m_keyLength*8; }
/// Encrypt a wxString
void Encrypt( std::string & str, pdf_long inputLen ) const;
/// Get the O object value (owner) /// Encrypt a character string
const unsigned char* GetOValue() const { return m_oValue; } virtual void Encrypt(unsigned char* str, pdf_long len) const = 0;
/// Get the P object value (protection) /// Calculate stream size
int GetPValue() const { return m_pValue; } virtual pdf_long CalculateStreamLength(pdf_long length) const;
/// Get the revision number of the encryption method /// Calculate stream offset
int GetRevision() const { return m_rValue; } virtual pdf_long CalculateStreamOffset() const;
/// Get the key length of the encryption key in bits /** Create a PdfString of MD5 data generated from a buffer in memory.
int GetKeyLength() const { return m_keyLength*8; } * \param pBuffer the buffer of which to calculate the MD5 sum
* \param nLength the length of the buffer
/// Encrypt a wxString *
void Encrypt( std::string & str, pdf_long inputLen ) const; * \returns an MD5 sum as PdfString
*/
/// Encrypt a character string static PdfString GetMD5String( const unsigned char* pBuffer, int nLengt
virtual void Encrypt(unsigned char* str, pdf_long len) const = 0; h );
/// Calculate stream size /** Set the reference of the object that is currently encrypted.
virtual pdf_long CalculateStreamLength(pdf_long length) const; *
* This value will be used in following calls of Encrypt
/// Calculate stream offset * to encrypt the object.
virtual pdf_long CalculateStreamOffset() const; *
* \see Encrypt
/** Create a PdfString of MD5 data generated from a buffer in memory. */
* \param pBuffer the buffer of which to calculate the MD5 sum inline void SetCurrentReference( const PdfReference & rRef );
* \param nLength the length of the buffer
*
* \returns an MD5 sum as PdfString
*/
static PdfString GetMD5String( const unsigned char* pBuffer, int nLength
);
/** Set the reference of the object that is currently encrypted.
*
* This value will be used in following calls of Encrypt
* to encrypt the object.
*
* \see Encrypt
*/
inline void SetCurrentReference( const PdfReference & rRef );
protected: protected:
PdfEncrypt() {}; PdfEncrypt() {};
// copy constructor // copy constructor
PdfEncrypt( const PdfEncrypt & rhs ); PdfEncrypt( const PdfEncrypt & rhs );
/// Pad a password to 32 characters /// Pad a password to 32 characters
void PadPassword(const std::string& password, unsigned char pswd[32]); void PadPassword(const std::string& password, unsigned char pswd[32]);
/// Compute owner key /// Compute owner key
void ComputeOwnerKey(unsigned char userPad[32], unsigned char ownerPad[32 void ComputeOwnerKey(unsigned char userPad[32], unsigned char ownerPad[
], 32],
int keylength, int revision, bool authenticate, int keylength, int revision, bool authenticate,
unsigned char ownerKey[32]); unsigned char ownerKey[32]);
/// Compute encryption key and user key
void ComputeEncryptionKey(const std::string & documentID,
unsigned char userPad[32], unsigned char ownerK
ey[32],
int pValue, int keyLength, int revision,
unsigned char userKey[32]);
/// Check two keys for equality /// Compute encryption key and user key
bool CheckKey(unsigned char key1[32], unsigned char key2[32]); void ComputeEncryptionKey(const std::string & documentID,
unsigned char userPad[32], unsigned char owne
rKey[32],
int pValue, int keyLength, int revision,
unsigned char userKey[32]);
/// RC4 encryption /// Check two keys for equality
void RC4(unsigned char* key, int keylen, bool CheckKey(unsigned char key1[32], unsigned char key2[32]);
unsigned char* textin, pdf_long textlen,
unsigned char* textout); /// RC4 encryption
void RC4(unsigned char* key, int keylen,
unsigned char* textin, pdf_long textlen,
unsigned char* textout);
/// Calculate the binary MD5 message digest of the given data /// Calculate the binary MD5 message digest of the given data
static void GetMD5Binary(const unsigned char* data, int length, unsigned static void GetMD5Binary(const unsigned char* data, int length, unsigne
char* digest); d char* digest);
/// Generate initial vector /// Generate initial vector
void GenerateInitialVector(unsigned char iv[16]); void GenerateInitialVector(unsigned char iv[16]);
/** Create the encryption key for the current object.
*
* \param pObjkey pointer to an array of at least MD5_HASHBYTES (=16)
bytes length
* \param pnKeyLen pointer to an integer where the actual keylength is
stored.
*/
void CreateObjKey( unsigned char objkey[16], int* pnKeyLen ) const;
/** Create the encryption key for the current object. EPdfEncryptAlgorithm m_eAlgorithm; ///< The used encryption algorith
* m
* \param pObjkey pointer to an array of at least MD5_HASHBYTES (=16) by int m_keyLength; ///< Length of encryption key
tes length int m_rValue; ///< Revision
* \param pnKeyLen pointer to an integer where the actual keylength is s int m_pValue; ///< P entry in pdf document
tored. EPdfKeyLength m_eKeyLength; ///< The key length
*/ std::string m_userPass; ///< User password
void CreateObjKey( unsigned char objkey[16], int* pnKeyLen ) const; std::string m_ownerPass; ///< Owner password
unsigned char m_rc4key[16]; ///< last RC4 key
EPdfEncryptAlgorithm m_eAlgorithm; ///< The used encryption algorithm unsigned char m_rc4last[256]; ///< last RC4 state table
int m_keyLength; ///< Length of encryption key unsigned char m_uValue[32]; ///< U entry in pdf document
int m_rValue; ///< Revision unsigned char m_oValue[32]; ///< O entry in pdf document
int m_pValue; ///< P entry in pdf document
EPdfKeyLength m_eKeyLength; ///< The key length
std::string m_userPass; ///< User password
std::string m_ownerPass; ///< Owner password
unsigned char m_rc4key[16]; ///< last RC4 key
unsigned char m_rc4last[256]; ///< last RC4 state table
unsigned char m_uValue[32]; ///< U entry in pdf document
unsigned char m_oValue[32]; ///< O entry in pdf document
private: private:
static int s_nEnabledEncryptionAlgorithms; ///< Or'ed int containing the enabled encryption algorithms static int s_nEnabledEncryptionAlgorithms; ///< Or'ed int containin g the enabled encryption algorithms
unsigned char m_encryptionKey[16]; ///< Encryption key unsigned char m_encryptionKey[16]; ///< Encryption key
PdfReference m_curReference; ///< Reference of the current PdfObj ect PdfReference m_curReference; ///< Reference of the current PdfO bject
std::string m_documentId; ///< DocumentID of the current docum ent std::string m_documentId; ///< DocumentID of the current doc ument
}; };
/** A class that is used to encrypt a PDF file (AES-128) /** A class that is used to encrypt a PDF file (AES-128)
* *
* Client code is working only with PdfEncrypt class and knows nothing * Client code is working only with PdfEncrypt class and knows nothing
* about PdfEncryptAES, it is created through CreatePdfEncrypt factory method * about PdfEncryptAES, it is created through CreatePdfEncrypt factory method
* *
*/ */
class PdfEncryptAES : public PdfEncrypt { class PdfEncryptAES : public PdfEncrypt {
skipping to change at line 510 skipping to change at line 515
PdfInputStream* CreateEncryptionInputStream( PdfInputStream* pInputS tream ); PdfInputStream* CreateEncryptionInputStream( PdfInputStream* pInputS tream );
PdfOutputStream* CreateEncryptionOutputStream( PdfOutputStream* pOut putStream ); PdfOutputStream* CreateEncryptionOutputStream( PdfOutputStream* pOut putStream );
void CreateEncryptionDictionary( PdfDictionary & rDictionary ) const ; void CreateEncryptionDictionary( PdfDictionary & rDictionary ) const ;
}; };
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
PdfEncrypt::EPdfEncryptAlgorithm PdfEncrypt::GetEncryptAlgorithm() const
{
return m_eAlgorithm;
}
// -----------------------------------------------------
//
// -----------------------------------------------------
void PdfEncrypt::SetCurrentReference( const PdfReference & rRef ) void PdfEncrypt::SetCurrentReference( const PdfReference & rRef )
{ {
m_curReference = rRef; m_curReference = rRef;
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfEncrypt::IsPrintAllowed() const bool PdfEncrypt::IsPrintAllowed() const
{ {
 End of changes. 19 change blocks. 
93 lines changed or deleted 107 lines changed or added


 PdfFont.h   PdfFont.h 
skipping to change at line 185 skipping to change at line 185
* or following whitespaces. * or following whitespaces.
*/ */
virtual void WriteStringToStream( const PdfString & rsString, PdfStream * pStream ); virtual void WriteStringToStream( const PdfString & rsString, PdfStream * pStream );
// Peter Petrov 24 September 2008 // Peter Petrov 24 September 2008
/** Embeds the font into PDF page /** Embeds the font into PDF page
* *
*/ */
virtual void EmbedFont(); virtual void EmbedFont();
/** Remember the glyphs used in the string in case of subsetting
*
* \param sText the text string which should be printed (is not allowe
d to be NULL!)
* \param lLen draw only lLen characters of pszText
*
* Only call if IsSubsetting() returns true. Might throw an exception
otherwise.
*
* \see IsSubsetting
*/
virtual void AddUsedSubsettingGlyphs( const PdfString & sText, long
lStringLen );
/** Embeds pending subset-font into PDF page
* Only call if IsSubsetting() returns true. Might throw an exception
otherwise.
*
* \see IsSubsetting
*/
virtual void EmbedSubsetFont();
/** Check if this is a subsetting font.
* \returns true if this is a subsetting font
*/
inline bool IsSubsetting() const;
protected: protected:
/** Get the base font name of this font /** Get the base font name of this font
* *
* \returns the base font name * \returns the base font name
*/ */
inline const PdfName& GetBaseFont() const; inline const PdfName& GetBaseFont() const;
void InitBase14Font(); void InitBase14Font();
const PdfEncoding* const m_pEncoding;
PdfFontMetrics* m_pMetrics;
bool m_bBold;
bool m_bItalic;
bool m_bUnderlined;
bool m_bStrikedOut;
bool m_bWasEmbedded;
bool m_isBase14;
bool m_bIsSubsetting;
PdfName m_Identifier;
private: private:
/** Initialize all variables /** default constructor, not implemented
*/
PdfFont(void);
/** copy constructor, not implemented
*/
PdfFont(const PdfFont& rhs);
/** assignment operator, not implemented
*/
PdfFont& operator=(const PdfFont& rhs);
/** Initialize all variables
*/ */
void InitVars(); void InitVars();
/** Used to specify if this represents a bold font /** Used to specify if this represents a bold font
* \param bBold if true this is a bold font. * \param bBold if true this is a bold font.
* *
* \see IsBold * \see IsBold
* *
* This can be called by PdfFontFactory to tell this font * This can be called by PdfFontFactory to tell this font
* object that it belongs to a bold font. * object that it belongs to a bold font.
skipping to change at line 219 skipping to change at line 265
/** Used to specify if this represents an italic font /** Used to specify if this represents an italic font
* \param bItalic if true this is an italic font. * \param bItalic if true this is an italic font.
* *
* \see IsItalc * \see IsItalc
* *
* This can be called by PdfFontFactory to tell this font * This can be called by PdfFontFactory to tell this font
* object that it belongs to an italic font. * object that it belongs to an italic font.
*/ */
inline void SetItalic( bool bItalic ); inline void SetItalic( bool bItalic );
private:
PdfName m_BaseFont; PdfName m_BaseFont;
protected:
const PdfEncoding* const m_pEncoding;
PdfFontMetrics* m_pMetrics;
bool m_bBold;
bool m_bItalic;
bool m_bUnderlined;
bool m_bStrikedOut;
bool m_bWasEmbedded;
bool m_isBase14;
PdfName m_Identifier;
}; };
PdfFont* CreateBase14Font(const char* pszFontName, const PdfEncoding * cons t pEncoding,PdfVecObjects *pvecObjects); PdfFont* CreateBase14Font(const char* pszFontName, const PdfEncoding * cons t pEncoding,PdfVecObjects *pvecObjects);
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
void PdfFont::SetBold( bool bBold ) void PdfFont::SetBold( bool bBold )
{ {
m_bBold = bBold; m_bBold = bBold;
skipping to change at line 391 skipping to change at line 423
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfFont::IsItalic() const bool PdfFont::IsItalic() const
{ {
return m_bItalic; return m_bItalic;
} }
// -----------------------------------------------------
//
// -----------------------------------------------------
bool PdfFont::IsSubsetting() const
{
return m_bIsSubsetting;
}
}; };
#endif // _PDF_FONT_H_ #endif // _PDF_FONT_H_
 End of changes. 6 change blocks. 
15 lines changed or deleted 59 lines changed or added


 PdfFontCache.h   PdfFontCache.h 
skipping to change at line 137 skipping to change at line 137
class PODOFO_API PdfFontCache { class PODOFO_API PdfFontCache {
typedef std::vector<TFontCacheElement> TSortedFontList; typedef std::vector<TFontCacheElement> TSortedFontList;
typedef TSortedFontList::iterator TISortedFontList; typedef TSortedFontList::iterator TISortedFontList;
typedef TSortedFontList::const_iterator TCISortedFontList; typedef TSortedFontList::const_iterator TCISortedFontList;
#if defined(PODOFO_HAVE_FONTCONFIG) #if defined(PODOFO_HAVE_FONTCONFIG)
static Util::PdfMutex m_FcMutex; static Util::PdfMutex m_FcMutex;
#endif #endif
public: public:
enum EFontCreationFlags {
eFontCreationFlags_None = 0, ///< No spec
ial settings
eFontCreationFlags_AutoSelectBase14 = 1, ///< Create automati
cally a base14 font if the fontname matches one of them
eFontCreationFlags_Type1Subsetting = 2 ///< Create subsette
d type1-font, which includes only used characters
};
/** Create an empty font cache /** Create an empty font cache
* *
* \param pParent a PdfVecObjects which is required * \param pParent a PdfVecObjects which is required
* to create new font objects * to create new font objects
*/ */
PdfFontCache( PdfVecObjects* pParent ); PdfFontCache( PdfVecObjects* pParent );
/** Destroy and empty the font cache /** Destroy and empty the font cache
*/ */
~PdfFontCache(); ~PdfFontCache();
skipping to change at line 174 skipping to change at line 180
PdfFont* GetFont( PdfObject* pObject ); PdfFont* GetFont( PdfObject* pObject );
/** Get a font from the cache. If the font does not yet /** Get a font from the cache. If the font does not yet
* exist, add it to the cache. * exist, add it to the cache.
* *
* \param pszFontName a valid fontname * \param pszFontName a valid fontname
* \param bBold if true search for a bold font * \param bBold if true search for a bold font
* \param bItalic if true search for an italic font * \param bItalic if true search for an italic font
* \param bEmbedd if true a font for embedding into * \param bEmbedd if true a font for embedding into
* PDF will be created * PDF will be created
* \param eFontCreationFlags special flag to specify how fonts should be created
* \param pEncoding the encoding of the font. The font will not take o wnership of this object. * \param pEncoding the encoding of the font. The font will not take o wnership of this object.
* \param optional: pszFileName path to a valid font file * \param optional: pszFileName path to a valid font file
* *
* \returns a PdfFont object or NULL if the font could * \returns a PdfFont object or NULL if the font could
* not be created or found. * not be created or found.
*/ */
PdfFont* GetFont( const char* pszFontName, bool bBold, bool bItalic, PdfFont* GetFont( const char* pszFontName, bool bBold, bool bItalic,
bool bEmbedd, bool bEmbedd, EFontCreationFlags eFontCreationFlags = eFontCreationFlags_AutoSelectBase14,
const PdfEncoding * const = PdfEncodingFactory::Globa lWinAnsiEncodingInstance(), const PdfEncoding * const = PdfEncodingFactory::Globa lWinAnsiEncodingInstance(),
const char* pszFileName = NULL ); const char* pszFileName = NULL );
#ifdef _WIN32 #ifdef _WIN32
/** Get a font from the cache. If the font does not yet /** Get a font from the cache. If the font does not yet
* exist, add it to the cache. * exist, add it to the cache.
* *
* \param pszFontName a valid fontname * \param pszFontName a valid fontname
* \param bBold if true search for a bold font * \param bBold if true search for a bold font
* \param bItalic if true search for an italic font * \param bItalic if true search for an italic font
skipping to change at line 249 skipping to change at line 256
* The font will not take ownership of this object. * The font will not take ownership of this object.
* \param optional: pszFileName path to a valid font file * \param optional: pszFileName path to a valid font file
* *
* \returns a PdfFont object or NULL if the font could * \returns a PdfFont object or NULL if the font could
* not be created or found. * not be created or found.
*/ */
PdfFont* GetFontSubset( const char* pszFontName, bool bBold, bool bItal ic, PdfFont* GetFontSubset( const char* pszFontName, bool bBold, bool bItal ic,
const PdfEncoding * const = PdfEncodingFactory:: GlobalWinAnsiEncodingInstance(), const PdfEncoding * const = PdfEncodingFactory:: GlobalWinAnsiEncodingInstance(),
const char* pszFileName = NULL); const char* pszFileName = NULL);
/** Embeds all pending subset-fonts
*
*/
void EmbedSubsetFonts();
#if defined(PODOFO_HAVE_FONTCONFIG) #if defined(PODOFO_HAVE_FONTCONFIG)
/** Get the path of a font file on a Unix system using fontconfig /** Get the path of a font file on a Unix system using fontconfig
* *
* This method is only available if PoDoFo was compiled with * This method is only available if PoDoFo was compiled with
* fontconfig support. * fontconfig support.
* *
* \param pConfig a handle to an initialized fontconfig library * \param pConfig a handle to an initialized fontconfig library
* \param pszFontName name of the requested font * \param pszFontName name of the requested font
* \param bBold if true find a bold font * \param bBold if true find a bold font
* \param bItalic if true find an italic font * \param bItalic if true find an italic font
skipping to change at line 294 skipping to change at line 306
* *
* \param itSorted iterator pointing to a location in vecContainer * \param itSorted iterator pointing to a location in vecContainer
* where a sorted insert can be made * where a sorted insert can be made
* \param vecContainer container where the font object should be added * \param vecContainer container where the font object should be added
* \param pMetrics a font metrics * \param pMetrics a font metrics
* \param bEmbedd if true the font will be embedded in the pdf file * \param bEmbedd if true the font will be embedded in the pdf file
* \param bBold if true this font will be treated as bold font * \param bBold if true this font will be treated as bold font
* \param bItalic if true this font will be treated as italic font * \param bItalic if true this font will be treated as italic font
* \param pszFontName a font name for debug output * \param pszFontName a font name for debug output
* \param pEncoding the encoding of the font. The font will not take o wnership of this object. * \param pEncoding the encoding of the font. The font will not take o wnership of this object.
* \param bSubsetting if true the font will be subsetted in the pdf fi le
* *
* \returns a font handle or NULL in case of error * \returns a font handle or NULL in case of error
*/ */
PdfFont* CreateFontObject( TISortedFontList itSorted, TSortedFontList & vecContainer, PdfFont* CreateFontObject( TISortedFontList itSorted, TSortedFontList & vecContainer,
PdfFontMetrics* pMetrics, bool bEmbedd, bool bBold, PdfFontMetrics* pMetrics, bool bEmbedd, bool bBold,
bool bItalic, const char* pszFontName, const bool bItalic, const char* pszFontName, const
PdfEncoding * const pEncoding ); PdfEncoding * const pEncoding,
bool bSubsetting
= false );
/** Create a font subset. /** Create a font subset.
* \param pMetrics a font metrics * \param pMetrics a font metrics
* \param pszFontName a font name for debug output * \param pszFontName a font name for debug output
* \param bBold if true this font will be treated as bold font * \param bBold if true this font will be treated as bold font
* \param bItalic if true this font will be treated as italic font * \param bItalic if true this font will be treated as italic font
* \param vecCharacters a list of Unicode character indeces that shoul d be embedded in the subset * \param vecCharacters a list of Unicode character indeces that shoul d be embedded in the subset
* *
* \returns a font handle or NULL in case of error * \returns a font handle or NULL in case of error
*/ */
 End of changes. 6 change blocks. 
3 lines changed or deleted 21 lines changed or added


 PdfFontFactory.h   PdfFontFactory.h 
skipping to change at line 38 skipping to change at line 38
class PdfFontMetrics; class PdfFontMetrics;
class PdfVecObjects; class PdfVecObjects;
enum EPdfFontFlags { enum EPdfFontFlags {
ePdfFont_Normal = 0x00, ePdfFont_Normal = 0x00,
ePdfFont_Embedded = 0x01, ePdfFont_Embedded = 0x01,
ePdfFont_Bold = 0x02, ePdfFont_Bold = 0x02,
ePdfFont_Italic = 0x04, ePdfFont_Italic = 0x04,
ePdfFont_BoldItalic = ePdfFont_Bold | ePdfFont_Italic, ePdfFont_BoldItalic = ePdfFont_Bold | ePdfFont_Italic,
ePdfFont_Subsetting = 0x08
}; };
/** This is a factory class which knows /** This is a factory class which knows
* which implementation of PdfFont is required * which implementation of PdfFont is required
* for a certain font type with certain features (like encoding). * for a certain font type with certain features (like encoding).
*/ */
class PODOFO_API PdfFontFactory { class PODOFO_API PdfFontFactory {
public: public:
/** Create a new PdfFont object. /** Create a new PdfFont object.
skipping to change at line 89 skipping to change at line 89
static EPdfFontType GetFontType( const char* pszFilename ); static EPdfFontType GetFontType( const char* pszFilename );
private: private:
/** Actually creates the font object for the requested type. /** Actually creates the font object for the requested type.
* Throws an exception in case of an error. * Throws an exception in case of an error.
* *
* \returns a new PdfFont object or NULL * \returns a new PdfFont object or NULL
*/ */
static PdfFont* CreateFontForType( EPdfFontType eType, PdfFontMetrics* pMetrics, static PdfFont* CreateFontForType( EPdfFontType eType, PdfFontMetrics* pMetrics,
const PdfEncoding* const pEncoding, const PdfEncoding* const pEncoding,
bool bEmbed, PdfVecObjects* pParent ); bool bEmbed, bool bSubsetting, PdfVe cObjects* pParent );
}; };
}; };
#endif /* _PDF_FONT_FACTORY_H_ */ #endif /* _PDF_FONT_FACTORY_H_ */
 End of changes. 2 change blocks. 
2 lines changed or deleted 2 lines changed or added


 PdfFontMetricsObject.h   PdfFontMetricsObject.h 
skipping to change at line 191 skipping to change at line 191
* \returns a binary buffer of data containing the font data * \returns a binary buffer of data containing the font data
*/ */
virtual const char* GetFontData() const; virtual const char* GetFontData() const;
/** Get the length of the actual font data - if it was loaded from memo ry. /** Get the length of the actual font data - if it was loaded from memo ry.
* \returns a the length of the font data * \returns a the length of the font data
*/ */
virtual pdf_long GetFontDataLen() const; virtual pdf_long GetFontDataLen() const;
private: private:
/** default constructor, not implemented
*/
PdfFontMetricsObject(void);
/** copy constructor, not implemented
*/
PdfFontMetricsObject(const PdfFontMetricsObject& rhs);
/** assignment operator, not implemented
*/
PdfFontMetricsObject& operator=(const PdfFontMetricsObject& rhs);
//Private members:
const PdfEncoding* const m_pEncoding; const PdfEncoding* const m_pEncoding;
PdfName m_sName; PdfName m_sName;
PdfArray m_bbox; PdfArray m_bbox;
PdfArray m_width; PdfArray m_width;
int m_nFirst; int m_nFirst;
int m_nLast; int m_nLast;
unsigned int m_nWeight; unsigned int m_nWeight;
int m_nItalicAngle; int m_nItalicAngle;
double m_dPdfAscent; double m_dPdfAscent;
 End of changes. 1 change blocks. 
0 lines changed or deleted 12 lines changed or added


 PdfFontTTFSubset.h   PdfFontTTFSubset.h 
skipping to change at line 109 skipping to change at line 109
* *
* @returns the number of glyphs in this font. * @returns the number of glyphs in this font.
*/ */
inline size_t GetSize() const; inline size_t GetSize() const;
private: private:
/** Hide default constructor /** Hide default constructor
*/ */
PdfFontTTFSubset() : m_bOwnDevice( false ) {} PdfFontTTFSubset() : m_bOwnDevice( false ) {}
/** copy constructor, not implemented
*/
PdfFontTTFSubset(const PdfFontTTFSubset& rhs);
/** assignment operator, not implemented
*/
PdfFontTTFSubset& operator=(const PdfFontTTFSubset& rhs);
void Init(); void Init();
/** Get the offset of a specified table. /** Get the offset of a specified table.
* @param pszTableName name of the table * @param pszTableName name of the table
*/ */
unsigned long GetTableOffset( const char* pszTableName ); unsigned long GetTableOffset( const char* pszTableName );
void GetNumberOfTables(); void GetNumberOfTables();
void GetNumberOfGlyphs(); void GetNumberOfGlyphs();
void SeeIfLongLocaOrNot(); void SeeIfLongLocaOrNot();
void InitTables(); void InitTables();
void GetStartOfTTFOffsets(); void GetStartOfTTFOffsets();
/** Get sz bytes from the offset'th bytes of the input file /** Get sz bytes from the offset'th bytes of the input file
* *
*/ */
void GetData(unsigned long offset, void* address, unsigned long sz); void GetData(unsigned long offset, void* address, unsigned long sz);
private:
/** Information of TrueType tables. /** Information of TrueType tables.
*/ */
struct TTrueTypeTable { struct TTrueTypeTable {
unsigned char m_tableName[4]; unsigned char m_tableName[4];
unsigned long m_checksum; unsigned long m_checksum;
unsigned long m_length; unsigned long m_length;
unsigned long m_offset; unsigned long m_offset;
std::string m_strTableName; // TODO: DS: REMOVE FIELD? std::string m_strTableName; // TODO: DS: REMOVE FIELD?
}; };
 End of changes. 2 change blocks. 
1 lines changed or deleted 7 lines changed or added


 PdfFontType1.h   PdfFontType1.h 
skipping to change at line 70 skipping to change at line 70
* \param pFont pointer to existing font * \param pFont pointer to existing font
* \param pszSuffix Suffix to add to font-id * \param pszSuffix Suffix to add to font-id
* \param pParent parent of the font object * \param pParent parent of the font object
*/ */
PdfFontType1( PdfFontType1* pFont, PdfFontMetrics* pMetrics, const char *pszSuffix, PdfVecObjects* pParent ); PdfFontType1( PdfFontType1* pFont, PdfFontMetrics* pMetrics, const char *pszSuffix, PdfVecObjects* pParent );
void InitBase14Font(); void InitBase14Font();
protected: protected:
/** Remember the glyphs used in the string in case of subsetting
*
* \param sText the text string which should be printed (is not allowe
d to be NULL!)
* \param lLen draw only lLen characters of pszText
*/
virtual void AddUsedSubsettingGlyphs( const PdfString & sText, long
lStringLen );
/** Embeds pending subset-font into PDF page
*
*/
virtual void EmbedSubsetFont();
/** Embed the font file directly into the PDF file. /** Embed the font file directly into the PDF file.
* *
* \param pDescriptor font descriptor object * \param pDescriptor font descriptor object
*/ */
virtual void EmbedFontFile( PdfObject* pDescriptor ); virtual void EmbedFontFile( PdfObject* pDescriptor );
private: private:
pdf_long FindInBuffer( const char* pszNeedle, const char* pszHaystack, pdf_long lLen ) const; pdf_long FindInBuffer( const char* pszNeedle, const char* pszHaystack, pdf_long lLen ) const;
int m_bUsed[8]; // bitmask for usage if char 00..ff
}; };
}; };
#endif // _PDF_FONT_TYPE1_H_ #endif // _PDF_FONT_TYPE1_H_
 End of changes. 2 change blocks. 
0 lines changed or deleted 16 lines changed or added


 PdfImage.h   PdfImage.h 
skipping to change at line 183 skipping to change at line 183
*/ */
void LoadFromTiff( const char* pszFilename ); void LoadFromTiff( const char* pszFilename );
#endif // PODOFO_HAVE_TIFF_LIB #endif // PODOFO_HAVE_TIFF_LIB
#ifdef PODOFO_HAVE_PNG_LIB #ifdef PODOFO_HAVE_PNG_LIB
/** Load the image data from a PNG file /** Load the image data from a PNG file
* \param pszFilename * \param pszFilename
*/ */
void LoadFromPng( const char* pszFilename ); void LoadFromPng( const char* pszFilename );
#endif // PODOFO_HAVE_PNG_LIB #endif // PODOFO_HAVE_PNG_LIB
/** Set an color/chroma-key mask on an image.
* The masked color will not be painted, i.e. masked as being transpar
ent.
*
* \param r red RGB value of color that should be masked
* \param g green RGB value of color that should be masked
* \param b blue RGB value of color that should be masked
* \param threshold colors are masked that are in the range [(r-thresh
old, r+threshold),(g-threshold, g+threshold),(b-threshold, b+threshold)]
*/
void SetImageChromaKeyMask(pdf_int64 r, pdf_int64 g, pdf_int64 b, pdf_i
nt64 threshold = 0);
/**
* Apply an interpolation to the image if the source resolution
* is lower than the resolution of the output device.
* Default is false.
* \param bValue whether the image should be interpolated
*/
void SetInterpolate(bool bValue);
private: private:
/** Set the actual image data from an input stream. /** Set the actual image data from an input stream.
* The data has to be encoded already and an appropriate * The data has to be encoded already and an appropriate
* filters key entry has to be set manually before! * filters key entry has to be set manually before!
* *
* \param nWidth width of the image in pixels * \param nWidth width of the image in pixels
* \param nHeight height of the image in pixels * \param nHeight height of the image in pixels
* \param nBitsPerComponent bits per color component of the image (dep ends on the image colorspace you have set * \param nBitsPerComponent bits per color component of the image (dep ends on the image colorspace you have set
* but is 8 in most cases) * but is 8 in most cases)
* \param pStream stream supplieding raw image data * \param pStream stream supplieding raw image data
 End of changes. 1 change blocks. 
0 lines changed or deleted 21 lines changed or added


 PdfImmediateWriter.h   PdfImmediateWriter.h 
skipping to change at line 54 skipping to change at line 54
* @param pDevice all stream streams are immediately written to this o utput device * @param pDevice all stream streams are immediately written to this o utput device
* while the document is created. * while the document is created.
* @param pVecObjects a vector of objects containing the objects which are written to disk * @param pVecObjects a vector of objects containing the objects which are written to disk
* @param pTrailer the trailer object * @param pTrailer the trailer object
* @param eVersion the PDF version of the document to write. * @param eVersion the PDF version of the document to write.
* The PDF version can only be set in the construc tor * The PDF version can only be set in the construc tor
* as it is the first item written to the document on disk. * as it is the first item written to the document on disk.
* @param pEncrypt pointer to an encryption object or NULL. If not NUL L * @param pEncrypt pointer to an encryption object or NULL. If not NUL L
* the PdfEncrypt object will be copied and used to en crypt the * the PdfEncrypt object will be copied and used to en crypt the
* created document. * created document.
* @param eWriteMode additional options for writing the pdf
*/ */
PdfImmediateWriter( PdfOutputDevice* pDevice, PdfVecObjects* pVecObject s, const PdfObject* pTrailer, PdfImmediateWriter( PdfOutputDevice* pDevice, PdfVecObjects* pVecObject s, const PdfObject* pTrailer,
EPdfVersion eVersion = ePdfVersion_1_5, PdfEncrypt* EPdfVersion eVersion = ePdfVersion_1_5, PdfEncrypt*
pEncrypt = NULL ); pEncrypt = NULL,
EPdfWriteMode eWriteMode = ePdfWriteMode_Default );
~PdfImmediateWriter(); ~PdfImmediateWriter();
/** Get the write mode used for wirting the PDF
* \returns the write mode
*/
inline EPdfWriteMode GetWriteMode() const;
/** Get the PDF version of the document /** Get the PDF version of the document
* The PDF version can only be set in the constructor * The PDF version can only be set in the constructor
* as it is the first item written to the document on disk * as it is the first item written to the document on disk
* *
* \returns EPdfVersion version of the pdf document * \returns EPdfVersion version of the pdf document
*/ */
inline EPdfVersion GetPdfVersion() const; inline EPdfVersion GetPdfVersion() const;
private: private:
void WriteObject( const PdfObject* pObject ); void WriteObject( const PdfObject* pObject );
skipping to change at line 116 skipping to change at line 123
private: private:
PdfVecObjects* m_pParent; PdfVecObjects* m_pParent;
PdfOutputDevice* m_pDevice; PdfOutputDevice* m_pDevice;
PdfXRef* m_pXRef; PdfXRef* m_pXRef;
PdfObject* m_pLast; PdfObject* m_pLast;
bool m_bOpenStream; bool m_bOpenStream;
}; };
// -----------------------------------------------------
//
// -----------------------------------------------------
inline EPdfWriteMode PdfImmediateWriter::GetWriteMode() const
{
return PdfWriter::GetWriteMode();
}
// -----------------------------------------------------
//
// -----------------------------------------------------
inline EPdfVersion PdfImmediateWriter::GetPdfVersion() const inline EPdfVersion PdfImmediateWriter::GetPdfVersion() const
{ {
return PdfWriter::GetPdfVersion(); return PdfWriter::GetPdfVersion();
} }
}; };
#endif /* _PDF_IMMEDIATE_WRITER_H_ */ #endif /* _PDF_IMMEDIATE_WRITER_H_ */
 End of changes. 4 change blocks. 
2 lines changed or deleted 20 lines changed or added


 PdfMemDocument.h   PdfMemDocument.h 
skipping to change at line 198 skipping to change at line 198
*/ */
void Write( const wchar_t* pszFilename ); void Write( const wchar_t* pszFilename );
#endif // _WIN32 #endif // _WIN32
/** Writes the complete document to an output device /** Writes the complete document to an output device
* *
* \param pDevice write to this output device * \param pDevice write to this output device
*/ */
void Write( PdfOutputDevice* pDevice ); void Write( PdfOutputDevice* pDevice );
/** Set the write mode to use when writing the PDF.
* \param eWriteMode write mode
*/
void SetWriteMode( EPdfWriteMode eWriteMode ) { m_eWriteMode = eWriteMo
de; }
/** Get the write mode used for wirting the PDF
* \returns the write mode
*/
virtual EPdfWriteMode GetWriteMode() const { return m_eWriteMode; }
/** Set the PDF Version of the document. Has to be called before Write( ) to /** Set the PDF Version of the document. Has to be called before Write( ) to
* have an effect. * have an effect.
* \param eVersion version of the pdf document * \param eVersion version of the pdf document
*/ */
void SetPdfVersion( EPdfVersion eVersion ) { m_eVersion = eVersion;} void SetPdfVersion( EPdfVersion eVersion ) { m_eVersion = eVersion;}
/** Get the PDF version of the document /** Get the PDF version of the document
* \returns EPdfVersion version of the pdf document * \returns EPdfVersion version of the pdf document
*/ */
EPdfVersion GetPdfVersion() const { return m_eVersion; } EPdfVersion GetPdfVersion() const { return m_eVersion; }
skipping to change at line 493 skipping to change at line 503
// as they're not defined. // as they're not defined.
explicit PdfMemDocument(const PdfMemDocument&); explicit PdfMemDocument(const PdfMemDocument&);
PdfMemDocument& operator=(const PdfMemDocument&); PdfMemDocument& operator=(const PdfMemDocument&);
bool m_bLinearized; bool m_bLinearized;
EPdfVersion m_eVersion; EPdfVersion m_eVersion;
PdfEncrypt* m_pEncrypt; PdfEncrypt* m_pEncrypt;
PdfParser* m_pParser; ///< This will be temporarily initialized to a PdfParser object so that SetPassword can work PdfParser* m_pParser; ///< This will be temporarily initialized to a PdfParser object so that SetPassword can work
EPdfWriteMode m_eWriteMode;
}; };
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfMemDocument::IsPrintAllowed() const bool PdfMemDocument::IsPrintAllowed() const
{ {
return m_pEncrypt ? m_pEncrypt->IsPrintAllowed() : true; return m_pEncrypt ? m_pEncrypt->IsPrintAllowed() : true;
} }
 End of changes. 2 change blocks. 
0 lines changed or deleted 12 lines changed or added


 PdfMutexWrapper.h   PdfMutexWrapper.h 
skipping to change at line 53 skipping to change at line 53
* *
* \param rMutex the mutex to be locked. * \param rMutex the mutex to be locked.
*/ */
PODOFO_NOTHROW inline PdfMutexWrapper( PdfMutex & rMutex ); PODOFO_NOTHROW inline PdfMutexWrapper( PdfMutex & rMutex );
/** Unlocks the mutex on destruction /** Unlocks the mutex on destruction
*/ */
inline ~PdfMutexWrapper(); inline ~PdfMutexWrapper();
private: private:
/** default constructor, not implemented
*/
PdfMutexWrapper(void);
/** copy constructor, not implemented
*/
PdfMutexWrapper(const PdfMutexWrapper& rhs);
/** assignment operator, not implemented
*/
PdfMutexWrapper& operator=(const PdfMutexWrapper& rhs);
PdfMutex& m_rMutex; PdfMutex& m_rMutex;
}; };
PdfMutexWrapper::PdfMutexWrapper( PdfMutex & rMutex ) PdfMutexWrapper::PdfMutexWrapper( PdfMutex & rMutex )
: m_rMutex( rMutex ) : m_rMutex( rMutex )
{ {
m_rMutex.Lock(); m_rMutex.Lock();
} }
PdfMutexWrapper::~PdfMutexWrapper() PdfMutexWrapper::~PdfMutexWrapper()
 End of changes. 1 change blocks. 
0 lines changed or deleted 10 lines changed or added


 PdfName.h   PdfName.h 
skipping to change at line 125 skipping to change at line 125
: PdfDataType(), m_Data(rhs.m_Data) : PdfDataType(), m_Data(rhs.m_Data)
{ {
} }
virtual ~PdfName(); virtual ~PdfName();
/** Write the name to an output device in PDF format. /** Write the name to an output device in PDF format.
* This is an overloaded member function. * This is an overloaded member function.
* *
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this
object
* or NULL to not encrypt this object
*/ */
void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt = NULL ) const; void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, const P dfEncrypt* pEncrypt = NULL) const;
/** \returns the unescaped value of this name object /** \returns the unescaped value of this name object
* without the leading slash * without the leading slash
*/ */
PODOFO_NOTHROW inline const std::string& GetName() const; PODOFO_NOTHROW inline const std::string& GetName() const;
/** \returns the unescaped length of this /** \returns the unescaped length of this
* name object * name object
*/ */
PODOFO_NOTHROW inline size_t GetLength() const; PODOFO_NOTHROW inline size_t GetLength() const;
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added


 PdfObject.h   PdfObject.h 
skipping to change at line 171 skipping to change at line 171
* *
* \returns the found value, which is never null * \returns the found value, which is never null
* \throws PdfError(ePdfError_NoObject) . * \throws PdfError(ePdfError_NoObject) .
*/ */
inline PdfObject* MustGetIndirectKey( const PdfName & key ) const; inline PdfObject* MustGetIndirectKey( const PdfName & key ) const;
/** Write the complete object to a file. /** Write the complete object to a file.
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
* \param eWriteMode additional options for writing the object
* \param keyStop if not KeyNull and a key == keyStop is found * \param keyStop if not KeyNull and a key == keyStop is found
* writing will stop right before this key! * writing will stop right before this key!
*/ */
void WriteObject( PdfOutputDevice* pDevice, PdfEncrypt* pEncrypt, const void WriteObject( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, P
PdfName & keyStop = PdfName::KeyNull ) const; dfEncrypt* pEncrypt,
const PdfName & keyStop = PdfName::KeyNull ) const;
/** Get the length of the object in bytes if it was written to disk now . /** Get the length of the object in bytes if it was written to disk now .
* \param eWriteMode additional options for writing the object
* \returns the length of the object * \returns the length of the object
*/ */
pdf_long GetObjectLength(); pdf_long GetObjectLength( EPdfWriteMode eWriteMode );
/** Get a indirect reference to this object /** Get a indirect reference to this object
* \returns a PdfReference pointing to this object. * \returns a PdfReference pointing to this object.
*/ */
inline const PdfReference & Reference() const; inline const PdfReference & Reference() const;
/** Get a handle to a PDF stream object /** Get a handle to a PDF stream object
* If the PDF object does not have a stream, * If the PDF object does not have a stream,
* one will be created. * one will be created.
* \returns a PdfStream object * \returns a PdfStream object
skipping to change at line 258 skipping to change at line 261
* Entries to the filter dictionary will be added if necessary. * Entries to the filter dictionary will be added if necessary.
*/ */
void FlateCompressStream(); void FlateCompressStream();
/** Calculate the byte offset of the key pszKey from the start of the o bject /** Calculate the byte offset of the key pszKey from the start of the o bject
* if the object was written to disk at the moment of calling this fun ction. * if the object was written to disk at the moment of calling this fun ction.
* *
* This function is very calculation intensive! * This function is very calculation intensive!
* *
* \param pszKey key to calculate the byte offset * \param pszKey key to calculate the byte offset
* \param eWriteMode additional options for writing the PDF
* \returns the offset of the key * \returns the offset of the key
*/ */
pdf_long GetByteOffset( const char* pszKey ); pdf_long GetByteOffset( const char* pszKey, EPdfWriteMode eWriteMode );
/** /**
* Dynamically load this object and any associated stream from a PDF fi le * Dynamically load this object and any associated stream from a PDF fi le
* by calling the virtual method DelayedStreamLoadImpl if the stream i s not * by calling the virtual method DelayedStreamLoadImpl if the stream i s not
* already loaded. Will call DelayedLoad() first if it is required. * already loaded. Will call DelayedLoad() first if it is required.
* *
* Call graph: * Call graph:
* *
* DelayedStreamLoad ---> DelayedLoad() --> DelayedLoadImpl() * DelayedStreamLoad ---> DelayedLoad() --> DelayedLoadImpl()
* | * |
 End of changes. 6 change blocks. 
4 lines changed or deleted 8 lines changed or added


 PdfPage.h   PdfPage.h 
skipping to change at line 95 skipping to change at line 95
bool SetPageWidth(int newWidth); bool SetPageWidth(int newWidth);
// added by Petr P. Petrov 21 Febrary 2010 // added by Petr P. Petrov 21 Febrary 2010
/** Set the current page height in PDF Units /** Set the current page height in PDF Units
* *
* \returns true if successfull, false otherwise * \returns true if successfull, false otherwise
* *
*/ */
bool SetPageHeight(int newHeight); bool SetPageHeight(int newHeight);
/** Page number inside of the document. The first page /** Set the trimbox in PDF Units
* \param rSize a PdfRect specifying the trimbox of the page (i.e the
/TrimBox key) in PDF units
*/
void SetTrimBox( const PdfRect & rSize );
/** Page number inside of the document. The first page
* has the number 1, the last page has the number * has the number 1, the last page has the number
* PdfPagesTree:GetTotalNumberOfPages() * PdfPagesTree:GetTotalNumberOfPages()
* *
* \returns the number of the page inside of the document * \returns the number of the page inside of the document
* *
* \see PdfPagesTree:GetTotalNumberOfPages() * \see PdfPagesTree:GetTotalNumberOfPages()
*/ */
unsigned int GetPageNumber() const; unsigned int GetPageNumber() const;
/** Creates a PdfRect with the page size as values which is needed to c reate a PdfPage object /** Creates a PdfRect with the page size as values which is needed to c reate a PdfPage object
 End of changes. 1 change blocks. 
1 lines changed or deleted 7 lines changed or added


 PdfRect.h   PdfRect.h 
skipping to change at line 71 skipping to change at line 71
/** Returns a string representation of the PdfRect /** Returns a string representation of the PdfRect
* \returns std::string representation as [ left bottom right top ] * \returns std::string representation as [ left bottom right top ]
*/ */
std::string ToString() const; std::string ToString() const;
/** Assigns the values of this PdfRect from the 4 values in the array /** Assigns the values of this PdfRect from the 4 values in the array
* \param inArray the array to load the values from * \param inArray the array to load the values from
*/ */
void FromArray( const PdfArray& inArray ); void FromArray( const PdfArray& inArray );
/** Get the bottom coordinate of the rectangle /** Intersect with another rect
* \param rRect the rect to intersect with
*/
void Intersect( const PdfRect & rRect );
/** Get the bottom coordinate of the rectangle
* \returns bottom * \returns bottom
*/ */
inline double GetBottom() const; inline double GetBottom() const;
/** Set the bottom coordinate of the rectangle /** Set the bottom coordinate of the rectangle
* \param dBottom * \param dBottom
*/ */
inline void SetBottom( double dBottom ); inline void SetBottom( double dBottom );
/** Get the left coordinate of the rectangle /** Get the left coordinate of the rectangle
 End of changes. 1 change blocks. 
1 lines changed or deleted 6 lines changed or added


 PdfReference.h   PdfReference.h 
skipping to change at line 100 skipping to change at line 100
* Assign the value of another object to this PdfReference. * Assign the value of another object to this PdfReference.
* *
* \param rhs the object to copy * \param rhs the object to copy
*/ */
PODOFO_NOTHROW inline const PdfReference & operator=( const PdfReferenc e & rhs ); PODOFO_NOTHROW inline const PdfReference & operator=( const PdfReferenc e & rhs );
/** Write the complete variant to an output device. /** Write the complete variant to an output device.
* This is an overloaded member function. * This is an overloaded member function.
* *
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this
object
* or NULL to not encrypt this object
*/ */
void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt = NULL ) const; void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, const P dfEncrypt* pEncrypt = NULL ) const;
/** /**
* Compare to PdfReference objects. * Compare to PdfReference objects.
* \returns true if both reference the same object * \returns true if both reference the same object
*/ */
PODOFO_NOTHROW inline bool operator==( const PdfReference & rhs ) const ; PODOFO_NOTHROW inline bool operator==( const PdfReference & rhs ) const ;
/** /**
* Compare to PdfReference objects. * Compare to PdfReference objects.
* \returns false if both reference the same object * \returns false if both reference the same object
 End of changes. 2 change blocks. 
1 lines changed or deleted 5 lines changed or added


 PdfStreamedDocument.h   PdfStreamedDocument.h 
skipping to change at line 81 skipping to change at line 81
* All data is written to an output device * All data is written to an output device
* immediately. * immediately.
* *
* \param pDevice an output device * \param pDevice an output device
* \param eVersion the PDF version of the document to write. * \param eVersion the PDF version of the document to write.
* The PDF version can only be set in the constructor * The PDF version can only be set in the constructor
* as it is the first item written to the document on disk. * as it is the first item written to the document on disk.
* \param pEncrypt pointer to an encryption object or NULL. If not NUL L * \param pEncrypt pointer to an encryption object or NULL. If not NUL L
* the PdfEncrypt object will be copied and used to en crypt the * the PdfEncrypt object will be copied and used to en crypt the
* created document. * created document.
* \param eWriteMode additional options for writing the pdf
*/ */
PdfStreamedDocument( PdfOutputDevice* pDevice, EPdfVersion eVersion = e PdfVersion_Default, PdfEncrypt* pEncrypt = NULL ); PdfStreamedDocument( PdfOutputDevice* pDevice, EPdfVersion eVersion = e PdfVersion_Default, PdfEncrypt* pEncrypt = NULL, EPdfWriteMode eWriteMode = ePdfWriteMode_Default );
/** Create a new PdfStreamedDocument. /** Create a new PdfStreamedDocument.
* All data is written to a file immediately. * All data is written to a file immediately.
* *
* \param pszFilename resulting PDF file * \param pszFilename resulting PDF file
* \param eVersion the PDF version of the document to write. * \param eVersion the PDF version of the document to write.
* The PDF version can only be set in the constructor * The PDF version can only be set in the constructor
* as it is the first item written to the document on disk. * as it is the first item written to the document on disk.
* \param pEncrypt pointer to an encryption object or NULL. If not NUL L * \param pEncrypt pointer to an encryption object or NULL. If not NUL L
* the PdfEncrypt object will be copied and used to en crypt the * the PdfEncrypt object will be copied and used to en crypt the
* created document. * created document.
* \param eWriteMode additional options for writing the pdf
*/ */
PdfStreamedDocument( const char* pszFilename, EPdfVersion eVersion = eP dfVersion_Default, PdfEncrypt* pEncrypt = NULL ); PdfStreamedDocument( const char* pszFilename, EPdfVersion eVersion = eP dfVersion_Default, PdfEncrypt* pEncrypt = NULL, EPdfWriteMode eWriteMode = ePdfWriteMode_Default );
#ifdef _WIN32 #ifdef _WIN32
/** Create a new PdfStreamedDocument. /** Create a new PdfStreamedDocument.
* All data is written to a file immediately. * All data is written to a file immediately.
* *
* \param pszFilename resulting PDF file * \param pszFilename resulting PDF file
* \param eVersion the PDF version of the document to write. * \param eVersion the PDF version of the document to write.
* The PDF version can only be set in the constructor * The PDF version can only be set in the constructor
* as it is the first item written to the document on disk. * as it is the first item written to the document on disk.
* \param pEncrypt pointer to an encryption object or NULL. If not NUL L * \param pEncrypt pointer to an encryption object or NULL. If not NUL L
* the PdfEncrypt object will be copied and used to en crypt the * the PdfEncrypt object will be copied and used to en crypt the
* created document. * created document.
* \param eWriteMode additional options for writing the pdf
* *
* This is an overloaded member function to allow working * This is an overloaded member function to allow working
* with unicode characters. On Unix systes you can also path * with unicode characters. On Unix systes you can also path
* UTF-8 to the const char* overload. * UTF-8 to the const char* overload.
*/ */
PdfStreamedDocument( const wchar_t* pszFilename, EPdfVersion eVersion = ePdfVersion_Default, PdfEncrypt* pEncrypt = NULL ); PdfStreamedDocument( const wchar_t* pszFilename, EPdfVersion eVersion = ePdfVersion_Default, PdfEncrypt* pEncrypt = NULL, EPdfWriteMode eWriteMode = ePdfWriteMode_Default );
#endif // _WIN32 #endif // _WIN32
~PdfStreamedDocument(); ~PdfStreamedDocument();
/** Close the document. The PDF file on disk is finished. /** Close the document. The PDF file on disk is finished.
* No other member function of this class maybe called * No other member function of this class maybe called
* after calling this function. * after calling this function.
*/ */
void Close(); void Close();
/** Get the write mode used for wirting the PDF
* \returns the write mode
*/
inline virtual EPdfWriteMode GetWriteMode() const;
/** Get the PDF version of the document /** Get the PDF version of the document
* \returns EPdfVersion version of the pdf document * \returns EPdfVersion version of the pdf document
*/ */
inline virtual EPdfVersion GetPdfVersion() const; inline virtual EPdfVersion GetPdfVersion() const;
/** Returns wether this PDF document is linearized, aka /** Returns wether this PDF document is linearized, aka
* weboptimized * weboptimized
* \returns true if the PDF document is linearized * \returns true if the PDF document is linearized
*/ */
inline virtual bool IsLinearized() const; inline virtual bool IsLinearized() const;
skipping to change at line 216 skipping to change at line 224
private: private:
/** Initialize the PdfStreamedDocument with an output device /** Initialize the PdfStreamedDocument with an output device
* \param pDevice write to this device * \param pDevice write to this device
* \param eVersion the PDF version of the document to write. * \param eVersion the PDF version of the document to write.
* The PDF version can only be set in the constructor * The PDF version can only be set in the constructor
* as it is the first item written to the document on disk. * as it is the first item written to the document on disk.
* \param pEncrypt pointer to an encryption object or NULL. If not NUL L * \param pEncrypt pointer to an encryption object or NULL. If not NUL L
* the PdfEncrypt object will be copied and used to en crypt the * the PdfEncrypt object will be copied and used to en crypt the
* created document. * created document.
* \param eWriteMode additional options for writing the pdf
*/ */
void Init( PdfOutputDevice* pDevice, EPdfVersion eVersion = ePdfVersion _Default, PdfEncrypt* pEncrypt = NULL ); void Init( PdfOutputDevice* pDevice, EPdfVersion eVersion = ePdfVersion _Default, PdfEncrypt* pEncrypt = NULL, EPdfWriteMode eWriteMode = ePdfWrite Mode_Default );
private: private:
PdfImmediateWriter* m_pWriter; PdfImmediateWriter* m_pWriter;
PdfOutputDevice* m_pDevice; PdfOutputDevice* m_pDevice;
PdfEncrypt* m_pEncrypt; PdfEncrypt* m_pEncrypt;
bool m_bOwnDevice; ///< If true m_pDevice is owned by th is object and has to be deleted bool m_bOwnDevice; ///< If true m_pDevice is owned by th is object and has to be deleted
}; };
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
EPdfWriteMode PdfStreamedDocument::GetWriteMode() const
{
return m_pWriter->GetWriteMode();
}
// -----------------------------------------------------
//
// -----------------------------------------------------
EPdfVersion PdfStreamedDocument::GetPdfVersion() const EPdfVersion PdfStreamedDocument::GetPdfVersion() const
{ {
return m_pWriter->GetPdfVersion(); return m_pWriter->GetPdfVersion();
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
bool PdfStreamedDocument::IsLinearized() const bool PdfStreamedDocument::IsLinearized() const
{ {
 End of changes. 10 change blocks. 
4 lines changed or deleted 21 lines changed or added


 PdfString.h   PdfString.h 
skipping to change at line 278 skipping to change at line 278
* as GetLength() will returns the number of bytes used for unicode st rings! * as GetLength() will returns the number of bytes used for unicode st rings!
* *
* *
* \returngs the number of characters in the string * \returngs the number of characters in the string
*/ */
inline pdf_long GetCharacterLength() const; inline pdf_long GetCharacterLength() const;
/** Write this PdfString in PDF format to a PdfOutputDevice /** Write this PdfString in PDF format to a PdfOutputDevice
* *
* \param pDevice the output device. * \param pDevice the output device.
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
*/ */
void Write ( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt = NUL L ) const; void Write ( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, const PdfEncrypt* pEncrypt = NULL ) const;
/** Copy an existing PdfString /** Copy an existing PdfString
* \param rhs another PdfString to copy * \param rhs another PdfString to copy
* \returns this object * \returns this object
*/ */
const PdfString & operator=( const PdfString & rhs ); const PdfString & operator=( const PdfString & rhs );
/** Compare two PdfString objects /** Compare two PdfString objects
* \param rhs another PdfString to compare * \param rhs another PdfString to compare
* \returns this object * \returns this object
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 PdfTokenizer.h   PdfTokenizer.h 
skipping to change at line 143 skipping to change at line 143
* nor a delimeter character. * nor a delimeter character.
*/ */
PODOFO_NOTHROW inline static bool IsRegular(const unsigned char ch); PODOFO_NOTHROW inline static bool IsRegular(const unsigned char ch);
/** /**
* True if the passed character is within the generally accepted "print able" * True if the passed character is within the generally accepted "print able"
* ASCII range. * ASCII range.
*/ */
PODOFO_NOTHROW inline static bool IsPrintable(const unsigned char ch); PODOFO_NOTHROW inline static bool IsPrintable(const unsigned char ch);
/**
* Get the hex value from a static map of a given hex character (0-9, A
-F, a-f).
*
* \param ch hex character
*
* \returns hex value or HEX_NOT_FOUND if invalid
*
* \see HEX_NOT_FOUND
*/
PODOFO_NOTHROW inline static int GetHexValue(const unsigned char ch);
/**
* Constant which is returned for invalid hex values.
*/
static const unsigned int HEX_NOT_FOUND;
protected: protected:
/** Read the next variant from the current file position /** Read the next variant from the current file position
* ignoring all comments. * ignoring all comments.
* *
* Raises an exception if there is no variant left in the file. * Raises an exception if there is no variant left in the file.
* *
* \param pszToken a token that has already been read * \param pszToken a token that has already been read
* \param eType type of the passed token * \param eType type of the passed token
* \param rVariant write the read variant to this value * \param rVariant write the read variant to this value
* \param pEncrypt an encryption object which is used to decrypt strin gs during parsing * \param pEncrypt an encryption object which is used to decrypt strin gs during parsing
skipping to change at line 226 skipping to change at line 242
void QuequeToken( const char* pszToken, EPdfTokenType eType ); void QuequeToken( const char* pszToken, EPdfTokenType eType );
protected: protected:
PdfRefCountedInputDevice m_device; PdfRefCountedInputDevice m_device;
PdfRefCountedBuffer m_buffer; PdfRefCountedBuffer m_buffer;
private: private:
// 256-byte array mapping character ordinal values to a truth value // 256-byte array mapping character ordinal values to a truth value
// indicating whether or not they are whitespace according to the PDF // indicating whether or not they are whitespace according to the PDF
// standard. // standard.
static const char * const m_delimiterMap; static const char * const s_delimiterMap;
static const char * const m_whitespaceMap; static const char * const s_whitespaceMap;
static const char m_octMap[]; ///< Map of bool values, if a certain cha static const char s_octMap[]; ///< Map of bool values, if a certain cha
r r
///< is a valid octal digit ///< is a valid octal digit
static const char * const m_escMap; ///< Mapping of escape sequences to static const char * const s_escMap; ///< Mapping of escape sequences to
there value there value
static const char * const s_hexMap; ///< Mapping of hex characters to t
here value
TTokenizerQueque m_deqQueque; TTokenizerQueque m_deqQueque;
// A vector which is used as a buffer to read strings. // A vector which is used as a buffer to read strings.
// It is a member of the class to avoid reallocations while parsing. // It is a member of the class to avoid reallocations while parsing.
std::vector<char> m_vecBuffer; // we use a vector instead of a string std::vector<char> m_vecBuffer; // we use a vector instead of a string
// because we might read a unicode // because we might read a unicode
// string which is allowed to contain 0 bytes. // string which is allowed to contain 0 bytes.
/// An istringstream which is used /// An istringstream which is used
/// to read double values instead of strtod /// to read double values instead of strtod
/// which is locale depend. /// which is locale depend.
std::istringstream m_doubleParser; std::istringstream m_doubleParser;
}; };
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
inline bool PdfTokenizer::IsWhitespace(const unsigned char ch) inline bool PdfTokenizer::IsWhitespace(const unsigned char ch)
{ {
return ( PdfTokenizer::m_whitespaceMap[ch] != 0 ); return ( PdfTokenizer::s_whitespaceMap[static_cast<size_t>(ch)] != 0 );
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
inline bool PdfTokenizer::IsDelimiter(const unsigned char ch) inline bool PdfTokenizer::IsDelimiter(const unsigned char ch)
{ {
return ( PdfTokenizer::m_delimiterMap[ch] != 0 ); return ( PdfTokenizer::s_delimiterMap[ch] != 0 );
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
inline bool PdfTokenizer::IsRegular(const unsigned char ch) inline bool PdfTokenizer::IsRegular(const unsigned char ch)
{ {
return !IsWhitespace(ch) && !IsDelimiter(ch); return !IsWhitespace(ch) && !IsDelimiter(static_cast<size_t>(ch));
} }
// ----------------------------------------------------- // -----------------------------------------------------
// //
// ----------------------------------------------------- // -----------------------------------------------------
inline bool PdfTokenizer::IsPrintable(const unsigned char ch) inline bool PdfTokenizer::IsPrintable(const unsigned char ch)
{ {
return ch > 32 && ch < 125; return ((ch > 32U) && (ch < 125U));
}
// -----------------------------------------------------
//
// -----------------------------------------------------
inline int PdfTokenizer::GetHexValue(const unsigned char ch)
{
return PdfTokenizer::s_hexMap[static_cast<size_t>(ch)];
} }
}; };
#endif // _PDF_TOKENIZER_H_ #endif // _PDF_TOKENIZER_H_
 End of changes. 7 change blocks. 
10 lines changed or deleted 37 lines changed or added


 PdfVariant.h   PdfVariant.h 
skipping to change at line 200 skipping to change at line 200
inline bool IsNull() const { return GetDataType() == ePdfDataType_Null; } inline bool IsNull() const { return GetDataType() == ePdfDataType_Null; }
/** \returns true if this variant is a reference (i.e. GetDataType() == ePdfDataType_Reference) /** \returns true if this variant is a reference (i.e. GetDataType() == ePdfDataType_Reference)
*/ */
inline bool IsReference() const { return GetDataType() == ePdfDataType_ Reference; } inline bool IsReference() const { return GetDataType() == ePdfDataType_ Reference; }
/** Write the complete variant to an output device. /** Write the complete variant to an output device.
* This is an overloaded member function. * This is an overloaded member function.
* *
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
*/ */
void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncrypt = NULL void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode,
) const; const PdfEncrypt* pEncrypt = NULL ) const;
/** Write the complete variant to an output device. /** Write the complete variant to an output device.
* \param pDevice write the object to this device * \param pDevice write the object to this device
* \param eWriteMode additional options for writing this object
* \param pEncrypt an encryption object which is used to encrypt this object * \param pEncrypt an encryption object which is used to encrypt this object
* or NULL to not encrypt this object * or NULL to not encrypt this object
* \param keyStop if not KeyNull and a key == keyStop is found * \param keyStop if not KeyNull and a key == keyStop is found
* writing will stop right before this key! * writing will stop right before this key!
* if IsDictionary returns true. * if IsDictionary returns true.
*/ */
virtual void Write( PdfOutputDevice* pDevice, const PdfEncrypt* pEncryp t, const PdfName & keyStop ) const; virtual void Write( PdfOutputDevice* pDevice, EPdfWriteMode eWriteMode, const PdfEncrypt* pEncrypt, const PdfName & keyStop ) const;
/** Converts the current object into a string representation /** Converts the current object into a string representation
* which can be written directly to a PDF file on disc. * which can be written directly to a PDF file on disc.
* \param rsData the object string is returned in this object. * \param rsData the object string is returned in this object.
* \param eWriteMode additional options for writing to a string
*/ */
void ToString( std::string & rsData ) const; void ToString( std::string & rsData, EPdfWriteMode eWriteMode = ePdfWri teMode_Clean ) const;
/** Set the value of this object as bool /** Set the value of this object as bool
* \param b the value as bool. * \param b the value as bool.
* *
* This will set the dirty flag of this object. * This will set the dirty flag of this object.
* \see IsDirty * \see IsDirty
*/ */
inline void SetBool( bool b ); inline void SetBool( bool b );
/** Get the value if this object is a bool. /** Get the value if this object is a bool.
 End of changes. 6 change blocks. 
4 lines changed or deleted 7 lines changed or added


 PdfWriter.h   PdfWriter.h 
skipping to change at line 53 skipping to change at line 53
/** The PdfWriter class writes a list of PdfObjects as PDF file. /** The PdfWriter class writes a list of PdfObjects as PDF file.
* The XRef section (which is the required table of contents for any * The XRef section (which is the required table of contents for any
* PDF file) is created automatically. * PDF file) is created automatically.
* *
* It does not know about pages but only about PdfObjects. * It does not know about pages but only about PdfObjects.
* *
* Most users will want to use PdfDocument. * Most users will want to use PdfDocument.
*/ */
class PODOFO_API PdfWriter { class PODOFO_API PdfWriter {
public: public:
/** Create a PdfWriter object from a PdfParser object /** Create a PdfWriter object from a PdfParser object
* \param pParser a pdf parser object * \param pParser a pdf parser object
*/ */
PdfWriter( PdfParser* pParser ); PdfWriter( PdfParser* pParser );
/** Create a new pdf file, based on an existing pdf file. /** Create a new pdf file, based on an existing pdf file.
* \param pDocument a PdfDocument * \param pDocument a PdfDocument
*/ */
PdfWriter( PdfDocument* pDocument ); PdfWriter( PdfDocument* pDocument );
skipping to change at line 97 skipping to change at line 98
*/ */
void Write( const wchar_t* pszFilename ); void Write( const wchar_t* pszFilename );
#endif // _WIN32 #endif // _WIN32
/** Writes the complete document to a PdfOutputDevice /** Writes the complete document to a PdfOutputDevice
* *
* \param pDevice write to the specified device * \param pDevice write to the specified device
*/ */
void Write( PdfOutputDevice* pDevice ); void Write( PdfOutputDevice* pDevice );
/** Set the write mode to use when writing the PDF.
* \param eWriteMode write mode
*/
void SetWriteMode( EPdfWriteMode eWriteMode ) { m_eWriteMode = eWriteMo
de; }
/** Get the write mode used for wirting the PDF
* \returns the write mode
*/
EPdfWriteMode GetWriteMode() const { return m_eWriteMode; }
/** Set the PDF Version of the document. Has to be called before Write( ) to /** Set the PDF Version of the document. Has to be called before Write( ) to
* have an effect. * have an effect.
* \param eVersion version of the pdf document * \param eVersion version of the pdf document
*/ */
void SetPdfVersion( EPdfVersion eVersion ) { m_eVersion = eVersion;} void SetPdfVersion( EPdfVersion eVersion ) { m_eVersion = eVersion; }
/** Get the PDF version of the document /** Get the PDF version of the document
* \returns EPdfVersion version of the pdf document * \returns EPdfVersion version of the pdf document
*/ */
EPdfVersion GetPdfVersion() const { return m_eVersion; } EPdfVersion GetPdfVersion() const { return m_eVersion; }
/** Enabled linearization for this document. /** Enabled linearization for this document.
* I.e. optimize it for web usage. Default is false. * I.e. optimize it for web usage. Default is false.
* \param bLinearize if true create a web optimized PDF file * \param bLinearize if true create a web optimized PDF file
*/ */
skipping to change at line 262 skipping to change at line 273
PdfObject* m_pTrailer; PdfObject* m_pTrailer;
bool m_bXRefStream; bool m_bXRefStream;
PdfEncrypt* m_pEncrypt; ///< If not NULL encrypt all strings and streams and create an encryption dictionary in the trailer PdfEncrypt* m_pEncrypt; ///< If not NULL encrypt all strings and streams and create an encryption dictionary in the trailer
PdfObject* m_pEncryptObj; ///< Used to temporarly store the encryp tion dictionary PdfObject* m_pEncryptObj; ///< Used to temporarly store the encryp tion dictionary
PdfString m_identifier; PdfString m_identifier;
private: private:
EPdfWriteMode m_eWriteMode;
EPdfVersion m_eVersion; EPdfVersion m_eVersion;
PdfPagesTree* m_pPagesTree; PdfPagesTree* m_pPagesTree;
bool m_bLinearized; bool m_bLinearized;
/** /**
* This value is required when writing * This value is required when writing
* a linearized PDF file. * a linearized PDF file.
* It represents the offset of the whitespace * It represents the offset of the whitespace
* character before the first line in the XRef * character before the first line in the XRef
 End of changes. 4 change blocks. 
1 lines changed or deleted 14 lines changed or added


 PdfXObject.h   PdfXObject.h 
skipping to change at line 72 skipping to change at line 72
*/ */
PdfXObject( const PdfRect & rRect, PdfVecObjects* pParent, const char* pszPrefix = NULL ); PdfXObject( const PdfRect & rRect, PdfVecObjects* pParent, const char* pszPrefix = NULL );
/** Create a new XObject from a page of another document /** Create a new XObject from a page of another document
* in a given document * in a given document
* *
* \param rDoc the document to create the XObject from * \param rDoc the document to create the XObject from
* \param nPage the page-number in rDoc to create the XObject from * \param nPage the page-number in rDoc to create the XObject from
* \param pParent the parent document of the XObject * \param pParent the parent document of the XObject
* \param pszPrefix optional prefix for XObject-name * \param pszPrefix optional prefix for XObject-name
* \param bUseTrimBox if true try to use trimbox for size of xo bject
*/ */
PdfXObject( const PdfMemDocument & rSourceDoc, int nPage, PdfDocument* pParent, const char* pszPrefix = NULL ); PdfXObject( const PdfMemDocument & rSourceDoc, int nPage, PdfDocument* pParent, const char* pszPrefix = NULL, bool bUseTrimBox = false );
/** Create a XObject from an existing PdfObject /** Create a XObject from an existing PdfObject
* *
* \param pObject an existing object which has to be * \param pObject an existing object which has to be
* a XObject * a XObject
*/ */
PdfXObject( PdfObject* pObject ); PdfXObject( PdfObject* pObject );
virtual ~PdfXObject() { } virtual ~PdfXObject() { }
 End of changes. 2 change blocks. 
1 lines changed or deleted 2 lines changed or added


 podofo.h   podofo.h 
skipping to change at line 76 skipping to change at line 76
#include "PdfFontTTFSubset.h" #include "PdfFontTTFSubset.h"
#include "PdfFunction.h" #include "PdfFunction.h"
#include "PdfImage.h" #include "PdfImage.h"
#include "PdfInfo.h" #include "PdfInfo.h"
#include "PdfInputDevice.h" #include "PdfInputDevice.h"
#include "PdfMemDocument.h" #include "PdfMemDocument.h"
#include "PdfMemStream.h" #include "PdfMemStream.h"
#include "PdfName.h" #include "PdfName.h"
#include "PdfNamesTree.h" #include "PdfNamesTree.h"
#include "PdfObject.h" #include "PdfObject.h"
#include "PdfObjectStreamParserObject.h"
#include "PdfOutlines.h" #include "PdfOutlines.h"
#include "PdfOutputDevice.h" #include "PdfOutputDevice.h"
#include "PdfPage.h" #include "PdfPage.h"
#include "PdfPagesTree.h" #include "PdfPagesTree.h"
#include "PdfPagesTreeCache.h" #include "PdfPagesTreeCache.h"
#include "PdfPainter.h" #include "PdfPainter.h"
#include "PdfPainterMM.h" #include "PdfPainterMM.h"
#include "PdfParser.h" #include "PdfParser.h"
#include "PdfParserObject.h" #include "PdfParserObject.h"
#include "PdfRect.h" #include "PdfRect.h"
 End of changes. 1 change blocks. 
0 lines changed or deleted 1 lines changed or added


 podofo_config.h   podofo_config.h 
skipping to change at line 13 skipping to change at line 13
/* /*
* *** THIS HEADER IS INCLUDED BY PdfCompilerCompat.h *** * *** THIS HEADER IS INCLUDED BY PdfCompilerCompat.h ***
* *** DO NOT INCLUDE DIRECTLY *** * *** DO NOT INCLUDE DIRECTLY ***
*/ */
#ifndef _PDF_COMPILERCOMPAT_H #ifndef _PDF_COMPILERCOMPAT_H
#error Please include PdfDefines.h instead #error Please include PdfDefines.h instead
#endif #endif
#define PODOFO_VERSION_MAJOR 0 #define PODOFO_VERSION_MAJOR 0
#define PODOFO_VERSION_MINOR 8 #define PODOFO_VERSION_MINOR 8
#define PODOFO_VERSION_PATCH 2 #define PODOFO_VERSION_PATCH 3
/* PoDoFo configuration options */ /* PoDoFo configuration options */
#define PODOFO_MULTI_THREAD #define PODOFO_MULTI_THREAD
/* somewhat platform-specific headers */ /* somewhat platform-specific headers */
#define PODOFO_HAVE_STRINGS_H 1 #define PODOFO_HAVE_STRINGS_H 1
#define PODOFO_HAVE_ARPA_INET_H 1 #define PODOFO_HAVE_ARPA_INET_H 1
/* #undef PODOFO_HAVE_WINSOCK2_H */ /* #undef PODOFO_HAVE_WINSOCK2_H */
/* #undef PODOFO_HAVE_MEM_H */ /* #undef PODOFO_HAVE_MEM_H */
/* #undef PODOFO_HAVE_CTYPE_H */ /* #undef PODOFO_HAVE_CTYPE_H */
 End of changes. 1 change blocks. 
1 lines changed or deleted 1 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/