mirror of
https://github.com/JakubMelka/PDF4QT.git
synced 2025-06-05 21:59:17 +02:00
Redact annotation, some fixes
This commit is contained in:
@@ -79,6 +79,8 @@ enum class AnnotationType
|
||||
PrinterMark,
|
||||
TrapNet,
|
||||
Watermark,
|
||||
Redact,
|
||||
Projection,
|
||||
_3D,
|
||||
RichMedia
|
||||
};
|
||||
@@ -647,6 +649,12 @@ protected:
|
||||
/// \param parameters Draw parameters
|
||||
void drawCharacterSymbol(QString text, PDFReal opacity, AnnotationDrawParameters& parameters) const;
|
||||
|
||||
/// Parses path. If path is incorrect, empty path is returned.
|
||||
/// \param storage Storage
|
||||
/// \param dictionary Annotation's dictionary
|
||||
/// \param closePath Close path when finishing?
|
||||
static QPainterPath parsePath(const PDFObjectStorage* storage, const PDFDictionary* dictionary, bool closePath);
|
||||
|
||||
private:
|
||||
PDFObjectReference m_selfReference; ///< Reference to self
|
||||
QRectF m_rectangle; ///< Annotation rectangle, in page coordinates, "Rect" entry
|
||||
@@ -1274,6 +1282,50 @@ private:
|
||||
PDFReal m_relativeVerticalOffset = 0.0;
|
||||
};
|
||||
|
||||
/// Redaction annotation represents content selection, which should
|
||||
/// be removed from the document.
|
||||
class PDFRedactAnnotation : public PDFMarkupAnnotation
|
||||
{
|
||||
public:
|
||||
inline explicit PDFRedactAnnotation() = default;
|
||||
|
||||
virtual AnnotationType getType() const override { return AnnotationType::Redact; }
|
||||
virtual void draw(AnnotationDrawParameters& parameters) const override;
|
||||
|
||||
const PDFAnnotationQuadrilaterals& getRedactionRegion() const { return m_redactionRegion; }
|
||||
const std::vector<PDFReal>& getInteriorColor() const { return m_interiorColor; }
|
||||
const PDFObject& getOverlay() const { return m_overlayForm; }
|
||||
const QString& getOverlayText() const { return m_overlayText; }
|
||||
bool isRepeat() const { return m_repeat; }
|
||||
const QByteArray& getDefaultAppearance() const { return m_defaultAppearance; }
|
||||
PDFInteger getJustification() const { return m_justification; }
|
||||
|
||||
protected:
|
||||
virtual QColor getFillColor() const override;
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
|
||||
PDFAnnotationQuadrilaterals m_redactionRegion;
|
||||
std::vector<PDFReal> m_interiorColor;
|
||||
PDFObject m_overlayForm; ///< Overlay form object
|
||||
QString m_overlayText;
|
||||
bool m_repeat = false;
|
||||
QByteArray m_defaultAppearance;
|
||||
PDFInteger m_justification = 0;
|
||||
};
|
||||
|
||||
class PDFProjectionAnnotation : public PDFMarkupAnnotation
|
||||
{
|
||||
public:
|
||||
inline explicit PDFProjectionAnnotation() = default;
|
||||
|
||||
virtual AnnotationType getType() const override { return AnnotationType::Projection; }
|
||||
|
||||
private:
|
||||
friend static PDFAnnotationPtr PDFAnnotation::parse(const PDFObjectStorage* storage, PDFObjectReference reference);
|
||||
};
|
||||
|
||||
/// 3D annotations represents 3D scene, which can be viewed in the application.
|
||||
class PDF3DAnnotation : public PDFAnnotation
|
||||
{
|
||||
|
Reference in New Issue
Block a user