aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/qpdf/QPDFWriter.hh1
-rw-r--r--libqpdf/QPDFWriter.cc35
2 files changed, 12 insertions, 24 deletions
diff --git a/include/qpdf/QPDFWriter.hh b/include/qpdf/QPDFWriter.hh
index 59a0dd98..33e76d99 100644
--- a/include/qpdf/QPDFWriter.hh
+++ b/include/qpdf/QPDFWriter.hh
@@ -431,7 +431,6 @@ class QPDFWriter
void enqueuePart(std::vector<QPDFObjectHandle>& part);
void writeEncryptionDictionary();
void writeHeader();
- void writePCLmHeader();
void writeHintStream(int hint_id);
qpdf_offset_t writeXRefTable(
trailer_e which, int first, int last, int size);
diff --git a/libqpdf/QPDFWriter.cc b/libqpdf/QPDFWriter.cc
index 454eeffa..a57d71f5 100644
--- a/libqpdf/QPDFWriter.cc
+++ b/libqpdf/QPDFWriter.cc
@@ -2514,9 +2514,17 @@ QPDFWriter::writeHeader()
writeString("%PDF-");
writeString(this->final_pdf_version);
- // This string of binary characters would not be valid UTF-8, so
- // it really should be treated as binary.
- writeString("\n%\xbf\xf7\xa2\xfe\n");
+ if (this->pclm)
+ {
+ // PCLm version
+ writeString("\n%PCLm 1.0\n");
+ }
+ else
+ {
+ // This string of binary characters would not be valid UTF-8, so
+ // it really should be treated as binary.
+ writeString("\n%\xbf\xf7\xa2\xfe\n");
+ }
writeStringQDF("%QDF-1.0\n\n");
// Note: do not write extra header text here. Linearized PDFs
@@ -2527,25 +2535,6 @@ QPDFWriter::writeHeader()
}
void
-QPDFWriter::writePCLmHeader()
-{
- setMinimumPDFVersion(pdf.getPDFVersion(), pdf.getExtensionLevel());
- this->final_pdf_version = this->min_pdf_version;
- this->final_extension_level = this->min_extension_level;
- if (! this->forced_pdf_version.empty())
- {
- this->final_pdf_version = this->forced_pdf_version;
- this->final_extension_level = this->forced_extension_level;
- }
-
- writeString("%PDF-");
- writeString(this->final_pdf_version);
- // PCLm version
- writeString("\n%PCLm 1.0\n");
- writeStringQDF("%QDF-1.0\n\n");
-}
-
-void
QPDFWriter::writeHintStream(int hint_id)
{
PointerHolder<Buffer> hint_buffer;
@@ -3260,7 +3249,7 @@ QPDFWriter::writePCLm()
// Start writing
- writePCLmHeader();
+ writeHeader();
writeString(this->extra_header_text);
// Image transform stream content for page strip images.