public static void Save(Dictionary <int, PdfiumPage> pages, string fileName) { var name = Path.GetFileNameWithoutExtension(fileName); var book = new PdfiumBook(); book.Name = name; book.Pages = new PdfiumPage[pages.Count]; int no = 0; foreach (var p in pages.Values) { book.Pages[no++] = PdfiumPage.Encode(p); } if (File.Exists(fileName)) { File.Delete(fileName); } using (var file = new StreamWriter(fileName)) { Serializer.Serialize(file, book); } }
public PdfuimDocument(PdfDocument document, string fileName) { TranslateCurrentPage = false; _document = document; _fileName = Path.ChangeExtension(fileName, ".xml"); _pages = PdfiumBook.Load(_fileName); AutoSplitText = true; OnlyAscii = true; HasSave = true; _queue = new ConcurrentQueue <int>(); }
public void Save() { PdfiumBook.Save(_pages, _fileName); HasSave = true; }