Skip to content

Instantly share code, notes, and snippets.

GroupDocs GroupDocsGists

Block or report user

Report or block GroupDocsGists

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View FilterOutlookMessagesByText.java
// 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)
View joinimages.java
// For complete examples and data files, please go to https://github.com/GroupDocs-Merger/GroupDocs.Merger-for-Java
// Variables.
string sourcePath = "C:\testfiles\";
long[] sourceFormatArray = {FileFormat.Bmp, FileFormat.Png, FileFormat.Tiff};
int[] rowNumberForElement = {1,2,2};
int[] columnNumberForElement = { 22, 23, 23 };
InputStream[] inputStreams = {new FileInputStream(sourcePath + test.bmp),new FileInputStream(sourcePath + test.png),new FileInputStream(sourcePath + test.tiff)}
int order = Order.JoinByRowsFirst
// Preparing.
View Examples-GroupDocs.Merger.Examples.Java-src-main-java-com-groupdocs-merger-examples-CommonUtilities-getDocumentInformation.java
// For complete examples and data files, please go to https://github.com/GroupDocs-Merger/GroupDocs.Merger-for-Java
String sourceFile = sourcePath + fileName;
String password = "somepassword";
InputStream fileStream = new FileInputStream(sourceFile);
// Get information about document
DocumentInfo resultInfo = handler.getDocumentInfo(fileStream);
// Get information about password protected document.
DocumentInfo docInfo = new DocumentHandler().getDocumentInfo(fileStream, password);
View Examples-GroupDocs.Merger.Examples.Java-src-main-java-com-groupdocs-merger-examples-CommonUtilities-getSupportedFormats.java
// For complete examples and data files, please go to https://github.com/GroupDocs-Merger/GroupDocs.Merger-for-Java
DocumentHandler handler = new DocumentHandler();
Map<String, Long> documentFormatsContainer = handler.getSupportedFormats();
for(Map.Entry<String, Long> item : documentFormatsContainer.entrySet())
System.out.println("Key:"+item.getKey()+"|Value:"+item.getValue());
View Examples-GroupDocs.Merger.Examples.Java-src-main-java-com-groupdocs-merger-examples-DocsManipulation-joinImagesOfKnownFormat.java
// For complete examples and data files, please go to https://github.com/GroupDocs-Merger/GroupDocs.Merger-for-Java
long[] sourceFormatArray = {FileFormat.Tiff, FileFormat.Png, FileFormat.Bmp};
int[] rowNumberForElement = {1,2,2};
int[] columnNumberForElement = {22,23,23};
InputStream[] inputStreams = {new FileInputStream(CommonUtilities.sourcePath + fileName),
new FileInputStream(CommonUtilities.sourcePath + fileName2),
new FileInputStream(CommonUtilities.sourcePath + fileName3)};
int order = Order.JoinByRowsFirst;
// Preparing.
View Viewer_NewStyle.cs
// Set output directory for saving rendered pages
string pageFilePathFormat = Path.Combine("D:\\output", "page_{0}.html");
using (Viewer viewer = new Viewer("D:\\storage\\sample.docx"))
{
// Set options to get HTML with embedded resources
HtmlViewOptions options = HtmlViewOptions.ForEmbeddedResources(pageFilePathFormat);
// Render document
viewer.View(options);
}
View addingEllipseAnnotationInPDF.Java
// For complete examples and data files, please go to https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-Java
AnnotationImageHandler annotator = new AnnotationImageHandler(Utilities.getConfiguration());
InputStream inputStream = new FileInputStream("E:\sample.pdf");
List<AnnotationInfo> annotations = new ArrayList<AnnotationInfo>();
// Ellipse annotation
AnnotationInfo ellipseAnnotation = new AnnotationInfo();
ellipseAnnotation.setBox(new Rectangle(430f, 272f, 66f, 51f));
ellipseAnnotation.setPageNumber(0);
ellipseAnnotation.setType(AnnotationType.Ellipse);
ellipseAnnotation.setCreatorName("Anonym A.");
View AddingEllipseAnnotationInPDF.cs
// For complete examples and data files, please go to https://github.com/groupdocs-annotation/GroupDocs.Annotation-for-.NET
// Get input file stream
Stream inputFile = new FileStream("E:\sample.pdf", FileMode.Open, FileAccess.ReadWrite);
// Initialize list of AnnotationInfo
List<AnnotationInfo> annotations = new List<AnnotationInfo>();
// Initialize ellipse annotation.
AnnotationInfo ellipse = new AnnotationInfo
{
Box = new Rectangle(100, 100, 50, 50),
Type = AnnotationType.Ellipse;
View ExportFile.cs
// Export annotation and save output file
CommonUtilities.SaveOutputDocument(inputFile, annotations, DocumentType.Pdf);
View ListAnnotation.cs
// Initialize list of AnnotationInfo
List<AnnotationInfo> annotations = new List<AnnotationInfo>();
// Initialize ellipse annotation.
AnnotationInfo ellipse = new AnnotationInfo
{
Box = new Rectangle(100, 100, 50, 50),
Type = AnnotationType.Ellipse;
};
// Add annotation to list
annotations.Add(ellipse);
You can’t perform that action at this time.