English

Document rendering and PDF viewer APIs for Word, Excel, PowerPoint, and Image files

View, display, and render PDF, DOCX, XLSX, PPTX, VSDX, MPP, DWG, PNG, TXT, HTML, and many other file types programmatically using the document viewer APIs for .NET and Java.

View all APIsTry our APIs for Free

The smart document viewing solutions for rendering documents and images

PDF, Word, Excel, PowerPoint, and Text are some of the most commonly used file formats in businesses to share and exchange information. Often organizations need to view or render these documents programmatically within their .NET or Java apps. Do you also have tons of documents in PDF, Word, Excel, and PowerPoint format that your company needs to make visible and accessible to employees? Would you like to integrate these data file formats into your .NET or Java applications? How about rendering PDF and MS Office documents, JPEG or PNG images, CAD drawings, and HTML files and displaying them in an easy-to-read way?

Are you interested in doing this directly from a local folder or stream without the need of uploading them somewhere first? If 'Yes’ was your response to any of these questions, you can use GroupDocs.Viewer for .NET and Java document viewing APIs and do it effortlessly.

Getting Started

For getting started with and installing the suitable GroupDocs.Viewer version, please check the .NET and Java guides.

Document viewing use cases

Please check some of the below-given use cases to help automate your document viewing requirements.

.NET and Java PDF Reader

PDF is perhaps the most widely used file format for displaying, sharing, or storing your personal and business data. Are you looking to read PDF documents, develop a PDF viewer in .NET or Java from scratch, or enhance the capabilities of your existing document viewing and processing software? If yes, we have just the solutions you need.

.NET and Java PDF Reader

C# .NET PDF reader

It's not just a simple, one-dimensional .NET PDF reader that you can master, you can also access additional file information such as the number of pages in the PDF document, page dimensions, and whether or not printing is allowed.
using GroupDocs.Viewer;
    using GroupDocs.Viewer.Options;
    using GroupDocs.Viewer.Results;
    using (var viewer = new Viewer("sample.pdf"))
{
        var viewInfoOptions = ViewInfoOptions.ForHtmlView();
        viewInfoOptions.ExtractText = true;
        var viewInfo = viewer.GetViewInfo(viewInfoOptions) as PdfViewInfo;
        // Display PDF file information.
        Console.WriteLine($"Document type: {viewInfo.FileType}");
        Console.WriteLine($"Number of pages: {viewInfo.Pages.Count}");
        Console.WriteLine($"Printing allowed: {viewInfo.PrintingAllowed}");
}    

Java PDF reader

Similarly, you can also read and access this information in Java PDF documents too. Enhance the capability of your PDF reader apps in Java by obtaining and displaying file-related information using the following code.
using (Viewer viewer = new Viewer("sample.pdf"))
{
        ViewInfoOptions viewInfoOptions = ViewInfoOptions.forHtmlView();
        PdfViewInfo viewInfo = viewer.GetViewInfo(viewInfoOptions) as PdfViewInfo;
    
        system.out.println("File type: " + viewInfo.getFileType());
        system.out.println("Pages count: " + viewInfo.getPages().getCount());
}

Learn to render PDF documents as images

If you have a business requirement to read and convert PDF documents to popular image formats, you can use our .NET and Java file viewer libraries and expertly render PDF files as JPEG or PNG formats within your applications.

Learn to render PDF documents as images

Render and convert PDF to JPEG in .NET

Please use the following code segment to render and convert PDF files to JPEG format in C#.
using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using (var viewer = new Viewer("sample.pdf"))
{
    // Create a PNG image for each PDF page.
    var viewOptions = new PngViewOptions("output_{0}.png");
    viewOptions.Width = 800;
    viewOptions.Height = 900;
    viewer.View(viewOptions);
}    

Render and convert PDF to PNG in Java

Java app developers can make use of the following code for rendering Java PDF files as PNG.
try (Viewer viewer = new Viewer("sample.pdf"))
{
        PngViewOptions viewOptions = new PngViewOptions("output_{0}.png");
        viewer.view(viewOptions);
}

How to render Microsoft Word files as PDF documents

The perfect solution for anyone who needs to render Microsoft Word documents into PDF files. Whether you need to send documents to clients or want to save a copy of a Word file, GroupDocs.Viewer for .NET and Java document viewing APIs are the right choice. Easily convert your Word documents into high-quality PDF files that look exactly like the original.

How to render Microsoft Word files as PDF documents

Render Word to PDF in C# .NET

Render DOCX to PDF within your C# .NET apps using the below-given code snippet:
using GroupDocs.Viewer;
using GroupDocs.Viewer.Options;
using (Viewer viewer = new Viewer("sample.docx"))
{
   PdfViewOptions viewOptions = new PdfViewOptions();
   viewer.View(viewOptions);
} 

Java Word to PDF rendering

For rendering or converting Word to PDF in Java, you may utilize the following code:
try (Viewer viewer = new Viewer("sample.docx")) {
  PdfViewOptions viewOptions = new PdfViewOptions();
  viewer.view(viewOptions);
} 
        

Are you looking to read and load your password-protected documents? Look no further!

There are a lot of situations where it is necessary to read encrypted files. For instance, when someone sends you a password-protected Word document, or when you need to open an encrypted PDF file that was uploaded by a customer. You can make full use of this feature and quickly render your secure documents with GroupDocs.Viewer for .NET and Java file viewer libraries.

Are you looking to read and load your password-protected documents? Look no further!

Display encrypted documents in .NET

Here’s how .NET app developers could load and view password-protected files. Please check the following code sample:
    LoadOptions loadOptions = new LoadOptions();
    loadOptions.Password = "123456";
    
    using (Viewer viewer = new Viewer("encrypted.docx", loadOptions))
    {
        HtmlViewOptions viewOptions = HtmlViewOptions.ForEmbeddedResources();
        viewer.View(viewOptions);
    }    
        

Render password-protected files in Java

Please use the following Java code to render your encrypted documents within your Java apps:
    LoadOptions loadOptions = new LoadOptions();
    loadOptions.setPassword("123456");
    
        try (Viewer viewer = new Viewer("sample.docx", loadOptions)) {
            HtmlViewOptions viewOptions = HtmlViewOptions.forEmbeddedResources();
            viewer.view(viewOptions);
        }    
        

Independently automate your document and image processing tasks

Why choose GroupDocs?

Unmatched file formats support

  • All popular file formats supported including documents, images, audio, videos, and ebooks.
  • PDF, DOC, DOCX, XLS, XLSX, PPT, PPTX, PUB, PNG, PSD, ODT, MSG, EML, MP3, MP4, and many more.

Extensively programmable libraries

  • Use GroupDocs APIs to build fully customizable .NET and Java apps.
  • Manipulate your business documents, spreadsheets, presentations, and images any way you like.

Hundreds of supported features

  • Convert Word or Excel to PDF, annotate PDFs, edit DOC, DOCX, or watermark files.
  • Work with esignatures, tables, mail-merge, attachments, shapes, and much more.

Tailored to your needs

  • Free trials and different paid licensing options to choose from.
  • Well-suited to individual users, startups, as well as small and large enterprises.

APIs for Developers

  • Programmatically process your digital documents and images in .NET and Java platforms.
  • Document APIs designed specifically for .NET and Java application developers.

Trusted by users globally

  • Preferred by developers and businesses alike, our libraries are used globally.
  • Generate optimised documents easily in standalone and distributed environments.

Do more with your documents and images

  • Create, render, edit, convert, compare, digitally sign, watermark, and export your files.
  • Experience endless possibilities by creating multi-functional, high-performance apps.

Simple integration and convenient application

  • Enjoy greater flexibility by integrating with your existing software applications.
  • Get up and running using a few lines of code with our super-fast and reliable APIs.

Multiple support channels

  • Need help? Look no further than one of our developer-led support options.
  • Explore the APIs structure, and documentation, or dive into the knowledge base.

Ready to get started?

Download Free Trial