Signed-off-by: Rui Chen <rui@chenrui.dev>
#include <cstdio>
#include <cstdlib>
#include <cstring>
+#include <memory>
#include <iconv.h>
}
vector<QPDFObjectHandle> contents = page.getPageContents();
- auto ph = PointerHolder<QPDFObjectHandle::StreamDataProvider>(new CombineFromContents_Provider(contents));
+ auto ph = std::shared_ptr<QPDFObjectHandle::StreamDataProvider>(new CombineFromContents_Provider(contents));
xo_stream.replaceStreamData(ph, QPDFObjectHandle::newNull(), QPDFObjectHandle::newNull());
return xo_stream;
}
{
const string to_copy[] = { "/Title", "/Author", "/Subject", "/Keywords", "/Creator", "/CreationDate" };
for (string key: to_copy)
- info.replaceOrRemoveKey(key, orig_info.getKey(key));
+ {
+ QPDFObjectHandle value = orig_info.getKey(key);
+ if (!value.isNull())
+ info.replaceKey(key, value);
+ }
}
}