summaryrefslogtreecommitdiff
path: root/poppler/TextOutputDev.h
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2019-11-28 16:31:32 +0100
committerAlbert Astals Cid <tsdgeos@yahoo.es>2019-12-05 23:45:30 +0000
commitac485b0309f5e51d74fdb7484b9f6a7f79448f52 (patch)
treeec49960cb2e06151d7d0c813d9593ffd1f097530 /poppler/TextOutputDev.h
parentaf86c7460a1e3bfc63d2868306ed712fa432dcb1 (diff)
Move textEOL and textPageBreaks out of GlobalParams to TextOutputDev
Diffstat (limited to 'poppler/TextOutputDev.h')
-rw-r--r--poppler/TextOutputDev.h22
1 files changed, 20 insertions, 2 deletions
diff --git a/poppler/TextOutputDev.h b/poppler/TextOutputDev.h
index 51e397f5..0d008b3d 100644
--- a/poppler/TextOutputDev.h
+++ b/poppler/TextOutputDev.h
@@ -70,6 +70,12 @@ enum SelectionStyle {
selectionStyleLine
};
+enum EndOfLineKind {
+ eolUnix, // LF
+ eolDOS, // CR+LF
+ eolMac // CR
+};
+
//------------------------------------------------------------------------
// TextFontInfo
//------------------------------------------------------------------------
@@ -626,7 +632,7 @@ public:
// Get the text which is inside the specified rectangle.
GooString *getText(double xMin, double yMin,
- double xMax, double yMax) const;
+ double xMax, double yMax, EndOfLineKind textEOL) const;
void visitSelection(TextSelectionVisitor *visitor,
const PDFRectangle *selection,
@@ -659,7 +665,7 @@ public:
// Dump contents of page to a file.
void dump(void *outputStream, TextOutputFunc outputFunc,
- bool physLayout);
+ bool physLayout, EndOfLineKind textEOL, bool pageBreaks);
// Get the head of the linked list of TextFlows.
const TextFlow *getFlows() const { return flows; }
@@ -912,6 +918,16 @@ public:
// last rasterized page.
const TextFlow *getFlows() const;
+ static constexpr EndOfLineKind defaultEndOfLine() {
+#if defined(_WIN32)
+ return eolDOS;
+#else
+ return eolUnix;
+#endif
+ }
+ void setTextEOL(EndOfLineKind textEOLA) { textEOL = textEOLA; }
+ void setTextPageBreaks(bool textPageBreaksA) { textPageBreaks = textPageBreaksA; }
+
private:
TextOutputFunc outputFunc; // output function
@@ -930,6 +946,8 @@ private:
// to skip watermarks drawn on top of body text, etc.
bool doHTML; // extra processing for HTML conversion
bool ok; // set up ok?
+ bool textPageBreaks; // insert end-of-page markers?
+ EndOfLineKind textEOL; // type of EOL marker to use
ActualText *actualText;
};