mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Tester for PoDoFo
This commit is contained in:
parent
1a5f73d86d
commit
71c8f750e7
26
src/calibre/utils/podofo/test.cpp
Normal file
26
src/calibre/utils/podofo/test.cpp
Normal file
@ -0,0 +1,26 @@
|
||||
#define USING_SHARED_PODOFO
|
||||
#include <podofo.h>
|
||||
#include <iostream>
|
||||
|
||||
using namespace PoDoFo;
|
||||
using namespace std;
|
||||
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
if (argc < 2) return 1;
|
||||
char *fname = argv[1];
|
||||
|
||||
PdfMemDocument doc(fname);
|
||||
PdfInfo* info = doc.GetInfo();
|
||||
cout << endl;
|
||||
cout << "is encrypted: " << doc.GetEncrypted() << endl;
|
||||
PdfString old_title = info->GetTitle();
|
||||
cout << "is hex: " << old_title.IsHex() << endl;
|
||||
PdfString new_title(reinterpret_cast<const pdf_utf16be*>("\0z\0z\0z"), 3);
|
||||
cout << "is new unicode: " << new_title.IsUnicode() << endl;
|
||||
info->SetTitle(new_title);
|
||||
|
||||
doc.Write("/t/x.pdf");
|
||||
cout << "Output written to: " << "/t/x.pdf" << endl;
|
||||
return 0;
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user