Skip to content

Instantly share code, notes, and snippets.

@GroupDocsGists
Created August 22, 2019 11:15
Show Gist options
  • Save GroupDocsGists/75ef4800f825ce5a65eea78c975c88c7 to your computer and use it in GitHub Desktop.
Save GroupDocsGists/75ef4800f825ce5a65eea78c975c88c7 to your computer and use it in GitHub Desktop.
GroupDocs.Viewer for Java 19.8
// For complete examples and data files, please go to https://github.com/GroupDocs-Viewer/GroupDocs.Viewer-for-Java
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath(STORAGE_PATH);
// Create ViewerImageHandler or use ViewerHtmlHandler to render into HTML
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
String guid = "sample.pst";
// Create ImageOptions with text filter (use HtmlOptions to render into HTML)
ImageOptions options = new ImageOptions();
options.getOutlookOptions().setTextFilter("Susan");
// Render document into image (List<PageHtml> is returned when rendering into HTML)
List<PageImage> pages = imageHandler.getPages(guid, options);
for (PageImage page : pages) {
// use page.getStream() to work with rendering result
}
// For complete examples and data files, please go to https://github.com/GroupDocs-Viewer/GroupDocs.Viewer-for-Java
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath(STORAGE_PATH);
// Create HTML handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = "sample.pst";
// Get outlook document info
OutlookDocumentInfoContainer documentInfoContainer = (OutlookDocumentInfoContainer) htmlHandler.getDocumentInfo(guid);
for (String folderName : documentInfoContainer.getFolders()) {
System.out.println("Folder name: " + folderName);
}
// For complete examples and data files, please go to https://github.com/GroupDocs-Viewer/GroupDocs.Viewer-for-Java
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath(STORAGE_PATH);
// Create HTML handler
ViewerHtmlHandler htmlHandler = new ViewerHtmlHandler(config);
String guid = "sample.pst";
// Create option object with specified folder name
DocumentInfoOptions options = new DocumentInfoOptions();
options.getOutlookOptions().setFolderName("Inbox");
// Get outlook document info
OutlookDocumentInfoContainer documentInfoContainer = (OutlookDocumentInfoContainer) htmlHandler.getDocumentInfo(guid, options);
for (String folderName : documentInfoContainer.getFolders()) {
System.out.println("Folder name: " + folderName);
}
// For complete examples and data files, please go to https://github.com/GroupDocs-Viewer/GroupDocs.Viewer-for-Java
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath(STORAGE_PATH);
// Create ViewerImageHandler or use ViewerHtmlHandler to render into HTML
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
String guid = "sample.pst";
// Create image options with specified folder name (use HtmlOptions to render into HTML)
ImageOptions options = new ImageOptions();
options.getOutlookOptions().setFolderName("Inbox");
// Render document into image (List<PageHtml> is returned when rendering into HTML)
List<PageImage> pages = imageHandler.getPages(guid, options);
for (PageImage page : pages) {
// use page.getStream() to work with rendering result
}
// For complete examples and data files, please go to https://github.com/GroupDocs-Viewer/GroupDocs.Viewer-for-Java
// Setup GroupDocs.Viewer config
ViewerConfig config = new ViewerConfig();
config.setStoragePath(STORAGE_PATH);
// Create ViewerImageHandler
ViewerImageHandler imageHandler = new ViewerImageHandler(config);
String guid = "sample.pst";
// Create pdf options with specified folder name
PdfFileOptions options = new PdfFileOptions();
options.getOutlookOptions().setFolderName("Inbox");
// Get pdf document
FileContainer fileContainer = imageHandler.getPdfFile(guid, options);
// Access PDF document using fileContainer.getStream()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment