public void Notify(PageLayoutCallbackArgs a)
 {
     switch (a.Event)
     {
     case PageLayoutEvent.PartReflowFinished:
         NotifyPartFinished(a);
         break;
     }
 }
            private void RenderPage(PageLayoutCallbackArgs a, int pageIndex)
            {
                ImageSaveOptions saveOptions = new ImageSaveOptions(SaveFormat.Png);

                saveOptions.PageIndex = pageIndex;
                saveOptions.PageCount = 1;

                using (FileStream stream =
                           new FileStream(ArtifactsDir + $@"PageLayoutCallback.page-{pageIndex + 1} {++mNum}.png",
                                          FileMode.Create))
                    a.Document.Save(stream, saveOptions);
            }
 private void NotifyPartFinished(PageLayoutCallbackArgs a)
 {
     Console.WriteLine($"Part at page {a.PageIndex + 1} reflow");
     RenderPage(a, a.PageIndex);
 }
Beispiel #4
0
 private void NotifyConversionFinished(PageLayoutCallbackArgs a)
 {
     Console.WriteLine($"Document \"{a.Document.BuiltInDocumentProperties.Title}\" converted to page format.");
 }