lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 5deba0f 1/7: Optionally write uncompressed PD


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 5deba0f 1/7: Optionally write uncompressed PDF files
Date: Mon, 12 Feb 2018 07:15:09 -0500 (EST)

branch: master
commit 5deba0fd9fa3cdedafe7aace8aded3fa0bb9223b
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Optionally write uncompressed PDF files
    
    Adapted Vadim's suggestion here:
      http://lists.nongnu.org/archive/html/lmi/2018-02/msg00063.html
    to write uncompressed PDF files, iff "--pyx=uncompressed_pdf" is
    specified on the command line. Compression remains the default, as
    always.
    
    A single, simple, default illustration PDF created thus:
      Ctrl-N I Enter Ctrl-I
    was 26386 bytes with compression, and 158922 without: six times as
    large.
    
    BTW, "--pyx" options may be combined, e.g.:
      --pyx=only_new_pdf,uncompressed_pdf
---
 pdf_writer_wx.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/pdf_writer_wx.cpp b/pdf_writer_wx.cpp
index b3da776..bfb1d76 100644
--- a/pdf_writer_wx.cpp
+++ b/pdf_writer_wx.cpp
@@ -24,6 +24,7 @@
 #include "pdf_writer_wx.hpp"
 
 #include "alert.hpp"
+#include "contains.hpp"
 #include "global_settings.hpp"
 #include "html.hpp"
 
@@ -74,6 +75,10 @@ pdf_writer_wx::pdf_writer_wx
     pdf_dc_.SetMapMode(wxMM_POINTS);
 
     pdf_dc_.StartDoc(wxString()); // Argument is not used.
+    pdf_dc_.GetPdfDocument()->SetCompression
+        (
+        !contains(global_settings::instance().pyx(), "uncompressed_pdf")
+        );
     pdf_dc_.StartPage();
 
     // Use a standard PDF Helvetica font (without embedding any custom fonts in



reply via email to

[Prev in Thread] Current Thread [Next in Thread]