mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
When saving PDF in PoDoFo dont collect garbage to avoid slowdowns with some PDF files
See #2041745 (metadata in PDF very slow or gives errors)
This commit is contained in:
parent
9ba1a63bde
commit
e8d3e37208
@ -6,12 +6,8 @@
|
||||
*/
|
||||
|
||||
#include "global.h"
|
||||
#include <iostream>
|
||||
#include <algorithm>
|
||||
#include <new>
|
||||
#include <string_view>
|
||||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
using namespace pdf;
|
||||
|
||||
|
@ -13,7 +13,6 @@
|
||||
#define USING_SHARED_PODOFO
|
||||
#include <podofo.h>
|
||||
#include <unordered_set>
|
||||
#include <unordered_map>
|
||||
using namespace PoDoFo;
|
||||
using namespace std::literals;
|
||||
|
||||
@ -130,9 +129,9 @@ object_as_reference(const PdfObject *o) {
|
||||
return o->IsReference() ? o->GetReference() : o->GetIndirectReference();
|
||||
}
|
||||
|
||||
// Needed to avoid PoDoFo clobbering the /Info and XMP metadata with its own nonsense
|
||||
// rename to NoMetadataUdate after https://github.com/podofo/podofo/commit/96689eb6e45b71eae1577ecb2d4a796c52e9a813
|
||||
static const PdfSaveOptions save_options = PdfSaveOptions::NoModifyDateUpdate;
|
||||
// NoMetadataUpdate needed to avoid PoDoFo clobbering the /Info and XMP metadata with its own nonsense
|
||||
// NoCollectGarbage needed to avoid slowdowns on writing, see https://github.com/podofo/podofo/issues/99#issuecomment-1787239479
|
||||
static const PdfSaveOptions save_options = PdfSaveOptions::NoMetadataUpdate | PdfSaveOptions::NoCollectGarbage;
|
||||
|
||||
class PdfReferenceHasher {
|
||||
public:
|
||||
|
Loading…
x
Reference in New Issue
Block a user