Built for Modern Java Development

Everything you need to process documents in your next great Java app — from high-performance APIs and
flexible deployment options to seamless integration with existing development workflows. Built upon the award-winning
document processing technology behind the DevExpress Office & PDF File API for .NET.

Comprehensive and High-Performance APIs

High-Performance APIs

Generate and process PDF documents, PowerPoint presentations, and barcodes using our consistent and intuitive APIs. Designed for speed and reliability, our API libraries help you automate document workflows, create high-quality output, and easily scale from desktop apps to server-side services.

Developer-Friendly Integration

Developer-Friendly Integration

Get started quickly with libraries designed for Java 21+. Add dependencies with Maven or Gradle, use your preferred IDE, and integrate document processing features into existing projects and CI/CD pipelines with minimal effort.

Cross-Platform & Cloud Ready

Cross-Platform & Cloud Ready

Run on Windows, Linux, and macOS without installing Microsoft Office®, Adobe Acrobat®, or other external dependencies. Deploy the same codebase to desktop apps, servers, containers, and cloud environments while maintaining consistent behavior and output quality.

Quick Start

Set up the DevExpress Office & PDF File API for Java on your machine and build high performance
document processing workflows in your next great DevExpress-powered Java application.

Install via Maven Central

Configure using your preferred build system (Gradle or Maven) and add the required DevExpress packages
to your Java project.

implementation("com.devexpress:devexpress-docs-pdf:XX.X.X")
implementation("com.devexpress:devexpress-docs-presentation:XX.X.X")
implementation("com.devexpress:devexpress-docs-barcode:XX.X.X")
Copy
 

Quick Start Code

  • C#
import com.devexpress.docs.pdf.*;
import com.devexpress.drawing.printing.*;

public class Main {
    public static void main(String[] args) throws Exception {
        try (PdfDocument pdfDocument = new PdfDocument()) {
            pdfDocument.getPages().add(DXPaperKind.LETTER);
        }
    }
}
Copy

System Requirements

DevExpress

v26.2

Java

JDK 21+

Build Tool

Maven 3.9+
Gradle 8.14+

IDE

IntelliJ IDEA
Eclipse
VS Code + Extension pack for Java
(latest stable version recommended)

Platform

Windows, Linux, macOS

Deployment

Docker, Azure, AWS

PDF Document API for Java

Create, modify, convert, and secure PDF files programmatically. Our strongly typed document object model (DOM)
offers full access to document structures: pages, content fragments (text, images, and shapes),
annotations, form fields, logical structure elements, and more.

Key Features
Create and Edit PDFs

Access PDF page content – text, images, graphics, and forms – as structured fragments. Generate, inspect, and modify any type of content without working with low-level PDF commands and content streams.

Organize Documents and Pages

Implement advanced document generation, assembly, and transformation workflows. Merge and split PDF files. Create, clone, reorder, and remove PDF pages with ease. Scale, rotate, resize, and reposition page content.

PDF Structure Tree

Access and modify the logical structure of PDF documents. Generate, inspect, and update tagged PDF elements. Generate documents in PDF/UA-1 and PDF/UA-2 formats to comply with accessibility and regulatory requirements.

Interactive Forms

Create, edit, and fill interactive PDF forms. Work with text fields, choice controls, buttons, signatures, and associated widget annotations. Read and populate PDF forms while exchanging form data in FDF, XFDF, XML, and TXT formats.

Fluent Search & Extraction

Inspect document content using search API and obtain detailed information about every match. Find, replace, remove, format, and annotate text content to implement advanced document automation scenarios.

Annotations

Create and manage annotations programmatically. Work with comments, free text notes, links, drawings, watermarks, stamps, redactions, and other annotation types while maintaining full control over appearance and behavior.

Document Security

Apply or remove encryption, manage document permissions, inspect security settings, and redact confidential data. Implement secure document processing workflows based on industry-standard PDF encryption technologies.

Attachments & Metadata

Add, extract, and manage file attachments. Embed ZUGFeRD electronic invoices to combine human-readable PDF content with machine-readable XML.

Access and manage both standard PDF document information properties and structured XMP metadata.

Create and Edit PDFs

Access PDF page content – text, images, graphics, and forms – as structured fragments. Generate, inspect, and modify any type of content without working with low-level PDF commands and content streams.

Organize Documents and Pages

Implement advanced document generation, assembly, and transformation workflows. Merge and split PDF files. Create, clone, reorder, and remove PDF pages with ease. Scale, rotate, resize, and reposition page content.

PDF Structure Tree

Access and modify the logical structure of PDF documents. Generate, inspect, and update tagged PDF elements. Generate documents in PDF/UA-1 and PDF/UA-2 formats to comply with accessibility and regulatory requirements.

Interactive Forms

Create, edit, and fill interactive PDF forms. Work with text fields, choice controls, buttons, signatures, and associated widget annotations. Read and populate PDF forms while exchanging form data in FDF, XFDF, XML, and TXT formats.

Fluent Search & Extraction

Inspect document content using search API and obtain detailed information about every match. Find, replace, remove, format, and annotate text content to implement advanced document automation scenarios.

Annotations

Create and manage annotations programmatically. Work with comments, free text notes, links, drawings, watermarks, stamps, redactions, and other annotation types while maintaining full control over appearance and behavior.

Document Security

Apply or remove encryption, manage document permissions, inspect security settings, and redact confidential data. Implement secure document processing workflows based on industry-standard PDF encryption technologies.

Attachments & Metadata

Add, extract, and manage file attachments. Embed ZUGFeRD electronic invoices to combine human-readable PDF content with machine-readable XML.

Access and manage both standard PDF document information properties and structured XMP metadata.

  • Java
import com.devexpress.docs.pdf.*;
import com.devexpress.drawing.*;
import com.devexpress.system.drawing.*;
import com.devexpress.drawing.printing.*;

import java.io.*;
import java.nio.file.*;
import java.nio.channels.*;

public class CreatePdfDocument {
    public static void main(String[] args) throws Exception {
        byte[] imageData = Files.readAllBytes(Path.of("images/devexpress-logo.png"));

        try (PdfDocument pdfDocument = new PdfDocument();
             DXImage logo = DXImage.fromStream(
                     new ByteArrayInputStream(imageData))) {

            // Add an A4 page to the document.
            Page page = pdfDocument.getPages().add(DXPaperKind.A4);

            // Add a title to the document.
            TextFragment textFragment = new TextFragment();
            textFragment.setText("Quarterly Sales Report");
            textFragment.setLocation(new PointF(50, 770));
            textFragment.setFont(new TextFont("Arial", TextFontStyle.BOLD));
            textFragment.setFontSize(24);
            page.addFragment(textFragment);

            // Add a paragraph to the document.
            ParagraphFragment paragraphFragment = new ParagraphFragment();
            paragraphFragment.setText("This report summarizes sales data for Q1 2026.");
            paragraphFragment.setLocation(new PointF(50, 730));
            paragraphFragment.setWidth(200);
            paragraphFragment.setFont(new TextFont("Arial"));
            paragraphFragment.setFontSize(12);
            page.addFragment(paragraphFragment);

            // Add an image to the document.
            ImageFragment imageFragment = new ImageFragment(logo);
            imageFragment.setLocation(new PointF(50, 600));
            page.addFragment(imageFragment);

            // Save the document to a PDF file.
            try (WritableByteChannel writableByteChannel =
                         FileChannel.open(Path.of("result.pdf"),
                                 StandardOpenOption.CREATE,
                                 StandardOpenOption.WRITE,
                                 StandardOpenOption.TRUNCATE_EXISTING)) {

                pdfDocument.save(writableByteChannel);
            }
        }
    }
}
Copy
  • Java
import com.devexpress.docs.pdf.*;

import java.io.*;
import java.nio.file.*;
import java.nio.channels.*;

public class OrganizeDocuments {
    public static void main(String[] args) throws Exception {
        // Create the final report.
        try (PdfDocument report = new PdfDocument()) {

            // Append the cover page.
            try (ReadableByteChannel channel =
                         FileChannel.open(Path.of("Cover.pdf"))) {
                report.appendDocument(channel);
            }

            // Append the executive summary.
            try (ReadableByteChannel channel =
                         FileChannel.open(Path.of("ExecutiveSummary.pdf"))) {
                report.appendDocument(channel);
            }

            // Append the sales report.
            try (ReadableByteChannel channel =
                         FileChannel.open(Path.of("SalesReport.pdf"))) {
                report.appendDocument(channel);
            }

            // Save the complete report.
            try (WritableByteChannel channel =
                         FileChannel.open(
                                 Path.of("QuarterlyReport.pdf"),
                                 StandardOpenOption.CREATE,
                                 StandardOpenOption.WRITE,
                                 StandardOpenOption.TRUNCATE_EXISTING)) {

                report.save(channel);
            }

            // Create a summary document.
            try (PdfDocument summary = new PdfDocument()) {

                // Copy the cover page.
                summary.getPages().add(
                        report.getPages().getFirst().deepClone());

                // Copy the executive summary page.
                summary.getPages().add(
                        report.getPages().get(1).deepClone());

                // Save the summary document.
                try (WritableByteChannel summaryChannel =
                             FileChannel.open(
                                     Path.of("QuarterlyReport-Summary.pdf"),
                                     StandardOpenOption.CREATE,
                                     StandardOpenOption.WRITE,
                                     StandardOpenOption.TRUNCATE_EXISTING)) {

                    summary.save(summaryChannel);
                }
            }
        }
    }
}
Copy
  • Java
package pdf;

import com.devexpress.docs.pdf.*;
import com.devexpress.system.drawing.*;
import com.devexpress.drawing.printing.*;

import java.io.*;
import java.util.*;
import java.nio.file.*;

public class CreatePdfDocument {
    public static void main(String[] args) throws Exception {
        try (PdfDocument document = new PdfDocument()) {
            Locale documentLocale = Locale.forLanguageTag("en-US");
            String title = "Invoice";

            // Specify PDF/UA metadata.
            document.getMetadata().getXmp()
                    .getXmpPdfUASchema()
                    .setPart(new XmpInteger(1));

            document.getMetadata().getXmp()
                    .getXmpDublinCoreSchema()
                    .getTitle()
                    .add(documentLocale.toLanguageTag(), title);

            Page page = document.getPages().add(DXPaperKind.A4);

            // Create the root Document structure element.
            StructureElement root = document.getStructureTree()
                    .addChildElement(Pdf17StructureType.DOCUMENT);

            // Add a section to the document structure.
            StructureElement section = root.addChildElement(Pdf17StructureType.SECT);

            // Add a heading element.
            StructureElement heading = section.addChildElement(Pdf17StructureType.H1);
            heading.addFragment(page, new TextFragment() {{
                setText(title);
                setLocation(new PointF(50, 800));
                setFont(new TextFont("Arial", TextFontStyle.BOLD));
                setFontSize(24);
            }});

            // Add a paragraph element.
            StructureElement paragraph = section.addChildElement(Pdf17StructureType.P);
            paragraph.addFragment(page, new TextFragment() {{
                setText("Invoice details");
                setLocation(new PointF(50, 760));
            }});

            // Save the tagged PDF document.
            try (OutputStream stream =
                         Files.newOutputStream(
                                 Path.of("TaggedDocument.pdf"))) {
                document.save(stream);
            }
        }
    }
}
Copy
  • Java
package pdf;

import com.devexpress.docs.pdf.*;
import com.devexpress.system.drawing.*;
import com.devexpress.drawing.printing.*;

import java.nio.channels.*;
import java.nio.file.*;
import java.util.*;

public class CreatePdfDocument {
    public static void main(String[] args) throws Exception {
        try (PdfDocument pdfDocument = new PdfDocument()) {
            // Add an A4 page to the document.
            Page page = pdfDocument.getPages().add(DXPaperKind.A4);

            // Full Name
            TextFragment fullNameLabel = new TextFragment();
            fullNameLabel.setText("Full Name:");
            fullNameLabel.setLocation(new PointF(40, 740));
            page.getFragments().add(fullNameLabel);

            TextBoxField fullNameField = new TextBoxField("FullName");
            fullNameField.setValue("John Smith");
            pdfDocument.getFields().add(fullNameField);

            page.getAnnotations().add(
                    new TextBoxWidgetAnnotation(
                            fullNameField,
                            new RectangleF(140, 728, 220, 22)));

            // Accept Terms
            TextFragment agreementLabel = new TextFragment();
            agreementLabel.setText("Accept Terms:");
            agreementLabel.setLocation(new PointF(40, 700));
            page.getFragments().add(agreementLabel);

            CheckBoxField agreementField = new CheckBoxField("Agreement");
            agreementField.setChecked(true);
            pdfDocument.getFields().add(agreementField);

            page.getAnnotations().add(
                    new CheckBoxWidgetAnnotation(
                            agreementField,
                            new RectangleF(140, 688, 18, 18)));

            // Country
            TextFragment countryLabel = new TextFragment();
            countryLabel.setText("Country:");
            countryLabel.setLocation(new PointF(40, 660));
            page.getFragments().add(countryLabel);

            ComboBoxField countryField = new ComboBoxField("Country");

            countryField.getItems().add(new ChoiceFieldItem("USA"));
            countryField.getItems().add(new ChoiceFieldItem("Canada"));
            countryField.getItems().add(new ChoiceFieldItem("Germany"));

            countryField.setValue("USA");
            pdfDocument.getFields().add(countryField);

            page.getAnnotations().add(
                    new ComboBoxWidgetAnnotation(
                            countryField,
                            new RectangleF(140, 648, 120, 22)));

            // Gender
            TextFragment genderLabel = new TextFragment();
            genderLabel.setText("Gender:");
            genderLabel.setLocation(new PointF(40, 620));
            page.getFragments().add(genderLabel);

            RadioGroupField genderField = new RadioGroupField("Gender");
            pdfDocument.getFields().add(genderField);

            RectangleF maleBounds = new RectangleF(140, 608, 18, 18);

            page.getAnnotations().add(
                    new RadioGroupItemWidgetAnnotation(
                            genderField,
                            "Male",
                            maleBounds));

            TextFragment maleLabel = new TextFragment();
            maleLabel.setText("Male");
            maleLabel.setLocation(new PointF(164, 620));
            page.getFragments().add(maleLabel);

            RectangleF femaleBounds = new RectangleF(220, 608, 18, 18);

            page.getAnnotations().add(
                    new RadioGroupItemWidgetAnnotation(
                            genderField,
                            "Female",
                            femaleBounds));

            TextFragment femaleLabel = new TextFragment();
            femaleLabel.setText("Female");
            femaleLabel.setLocation(new PointF(244, 620));
            page.getFragments().add(femaleLabel);

            genderField.setValue("Male");

            // Save the document.
            try (WritableByteChannel channel =
                         FileChannel.open(
                                 Path.of("Result.pdf"),
                                 StandardOpenOption.CREATE,
                                 StandardOpenOption.WRITE,
                                 StandardOpenOption.TRUNCATE_EXISTING)) {

                pdfDocument.save(channel);
            }
        }
    }
}
Copy
  • Java
package pdf;

import com.devexpress.docs.pdf.*;
import com.devexpress.system.drawing.*;

import java.nio.channels.*;
import java.nio.file.*;
import java.util.*;

public class RedactPdfDocument {
    public static void main(String[] args) throws Exception {
        try (FileChannel fileChannel = FileChannel.open(Path.of("Document.pdf"));
             PdfDocument pdfDocument = new PdfDocument(fileChannel)) {

            TextSearchOptions options = new TextSearchOptions(
                    false,   // Match case.
                    true     // Match whole words.
            );

            // Search for specific text and redact it.
            Iterable<TextSearchInfo> results =
                    pdfDocument.findText("myemail@company.com", options);

            // Process search results.
            for (TextSearchInfo result : results) {
                // Get the page that contains the matched text.
                Page page = pdfDocument.getPages().get(result.getPageIndex());
                List<RedactionAnnotation> redactions = new ArrayList<>();

                // Store the bounding boxes for all matched text fragments.
                List<RectangleF> areas = new ArrayList<>();

                for (TextMatchInfo match : result.getMatches()) {
                    for (TextMatchFragment fragment : match.getMatchFragments()) {
                        areas.add(fragment.getRectangle().getBoundingBox());
                    }
                }

                // Create a redaction annotation for each text fragment.
                for(RectangleF rectangle : areas) {
                    RedactionAnnotation annotation = new RedactionAnnotation(rectangle);
                    annotation.setColor(PdfColor.getRed());
                    annotation.setFillColor(PdfColor.getBlack());

                    // Add the annotation to the page.
                    page.getAnnotations().add(annotation);
                    redactions.add(annotation);
                }

                // Apply redaction annotations.
                pdfDocument.applyRedaction(
                        pdfDocument.getPages().indexOf(page),
                        redactions.toArray(new RedactionAnnotation[0])
                );
            }

            // Save the document.
            try (WritableByteChannel channel =
                         FileChannel.open(
                                 Path.of("Result.pdf"),
                                 StandardOpenOption.CREATE,
                                 StandardOpenOption.WRITE,
                                 StandardOpenOption.TRUNCATE_EXISTING)) {

                pdfDocument.save(channel);
            }
        }
    }
}
Copy
  • Java
package pdf;

import com.devexpress.docs.pdf.*;
import com.devexpress.system.drawing.*;

import java.nio.channels.*;
import java.nio.file.*;
import java.time.*;

public class CreatePdfDocument {
    public static void main(String[] args) throws Exception {
        try (FileChannel fileChannel = FileChannel.open(Path.of("Document.pdf"));
             PdfDocument pdfDocument = new PdfDocument(fileChannel)) {

            Page page = pdfDocument.getPages().getFirst();

            // Add a free text annotation.
            FreeTextAnnotation freeTextAnnotation = new FreeTextAnnotation(
                    new RectangleF(200, 520, 260, 220));

            freeTextAnnotation.setTitle("John Smith");
            freeTextAnnotation.setSubject("Editorial Review");
            freeTextAnnotation.setContent("Update this section.");
            freeTextAnnotation.setTextJustification(TextJustification.LEFT_JUSTIFIED);
            freeTextAnnotation.setDefaultStyle("font: Times-Roman 12pt; color: #2B579A;");
            freeTextAnnotation.setOpacity(0.5);

            page.getAnnotations().add(freeTextAnnotation);

            // Add a text annotation (sticky note).
            TextAnnotation textAnnotation = new TextAnnotation(
                    new RectangleF(50, 430, 24, 36));

            textAnnotation.setTitle("Brian Zetc");
            textAnnotation.setContent("Please review this paragraph.");
            textAnnotation.setColor(PdfColor.getLightGray());

            page.getAnnotations().add(textAnnotation);

            // Add a dynamic Reviewed rubber stamp annotation.
            RubberStampAnnotation stamp = new RubberStampAnnotation(
                            new RectangleF(80, 510, 140, 30),
                            RubberStampAnnotationIconName.DReviewed);

            stamp.setTitle("John Smith");
            stamp.setContent("Reviewed.");
            stamp.setCreationDate(OffsetDateTime.now());

            page.getAnnotations().add(stamp);

            // Save the document.
            try (WritableByteChannel channel =
                         FileChannel.open(
                                 Path.of("Result.pdf"),
                                 StandardOpenOption.CREATE,
                                 StandardOpenOption.WRITE,
                                 StandardOpenOption.TRUNCATE_EXISTING)) {

                pdfDocument.save(channel);
            }
        }
    }
}
Copy
  • Java
package pdf;

import com.devexpress.docs.pdf.*;

import java.nio.channels.*;
import java.nio.file.*;

public class SecurePdfDocument {
    public static void main(String[] args) throws Exception {
        try (FileChannel fileChannel = FileChannel.open(Path.of("Document.pdf"));
             PdfDocument pdfDocument = new PdfDocument(fileChannel)) {

            // Create encryption settings and specify user and owner passwords.
            EncryptionOptions encryptionOptions =
                    new EncryptionOptions("ownerPassword", "userPassword");

            // Restrict content extraction.
            encryptionOptions.setDataExtractionPermissions(
                    DocumentDataExtractionPermissions.NOT_ALLOWED);

            // Allow low-quality printing only.
            encryptionOptions.setPrintPermissions(
                    DocumentPrintPermissions.LOW_QUALITY);

            // Prevent document modifications.
            encryptionOptions.setModificationPermissions(
                    DocumentModificationPermissions.NOT_ALLOWED);

            // Use the AES-256 encryption algorithm.
            encryptionOptions.setAlgorithm(EncryptionAlgorithm.AES_256);

            // Encrypt the document with the specified settings.
            pdfDocument.encrypt(encryptionOptions);

            // Save the document.
            try (WritableByteChannel channel =
                         FileChannel.open(
                                 Path.of("Document_encrypted.pdf"),
                                 StandardOpenOption.CREATE,
                                 StandardOpenOption.WRITE,
                                 StandardOpenOption.TRUNCATE_EXISTING)) {

                pdfDocument.save(channel);
            }
        }
    }
}
Copy
  • Java
package pdf;

import com.devexpress.docs.pdf.*;
import com.devexpress.drawing.printing.*;

import java.nio.channels.*;
import java.nio.file.*;

public class CreatePdfDocument {
    public static void main(String[] args) throws Exception {
        try (PdfDocument pdfDocument = new PdfDocument()) {

            // Add an A4-size page to the document.
            pdfDocument.getPages().add(DXPaperKind.A4);

            // Create an attachment.
            Attachment attachment = new Attachment();
            attachment.setFileName("sample.txt");
            attachment.setData(Files.readAllBytes(Path.of("sample.txt")));
            attachment.setMimeType("text/plain");
            attachment.setDescription("Sample text file");
            attachment.setRelationship(AssociatedFileRelationship.SOURCE);

            // Add attachment to the document.
            pdfDocument.getAttachments().add(attachment);

            // Specify document properties.
            DocumentInfo documentInfo = new DocumentInfo();

            documentInfo.setTitle("Document Title");
            documentInfo.setAuthor("Author Name");
            documentInfo.setSubject("Subject");
            documentInfo.setKeywords("Keywords");
            documentInfo.setProducer("Producer");
            documentInfo.setCreator("Creator");

            pdfDocument.getMetadata().setDocumentInfo(documentInfo);

            // Save the document.
            try (WritableByteChannel channel =
                         FileChannel.open(Path.of("Result.pdf"),
                                 StandardOpenOption.CREATE,
                                 StandardOpenOption.WRITE,
                                 StandardOpenOption.TRUNCATE_EXISTING)) {

                pdfDocument.save(channel);
            }
        }
    }
}
Copy

PowerPoint Presentation API for Java

Generate, analyze, modify, and convert Microsoft PowerPoint presentations within your Java app.

Key Features
Microsoft PowerPoint Compatibility

Generate, load, edit, and save PPTX presentations. The API preserves slide objects, layouts, themes, and formatting to ensure compatibility with Microsoft PowerPoint.

Presentation Management

Build a presentation from scratch. Generate and modify slide masters and layouts. Add, remove, copy, extract, and rearrange slides.

Shape Support

Insert and customize shapes, images, text boxes, placeholders, and tables.

Content Management & Extraction

Access, modify, and format slide content - text, images, tables, placeholders, and speaker notes.

Export Capabilities

Once you are done editing a presentation, save it as a PPTX file, convert to PDF, or export slides to image formats (PNG, JPEG, SVG, and more).

Microsoft PowerPoint Compatibility

Generate, load, edit, and save PPTX presentations. The API preserves slide objects, layouts, themes, and formatting to ensure compatibility with Microsoft PowerPoint.

Presentation Management

Build a presentation from scratch. Generate and modify slide masters and layouts. Add, remove, copy, extract, and rearrange slides.

Shape Support

Insert and customize shapes, images, text boxes, placeholders, and tables.

Content Management & Extraction

Access, modify, and format slide content - text, images, tables, placeholders, and speaker notes.

Export Capabilities

Once you are done editing a presentation, save it as a PPTX file, convert to PDF, or export slides to image formats (PNG, JPEG, SVG, and more).

  • Java
import com.devexpress.docs.presentation.*;
import java.nio.channels.*;
import java.nio.file.*;

public class UpdatePresentation {
    public static void main(String[] args) throws Exception {
        // Load an existing presentation.
        Path path = Path.of("presentation.pptx");
        try (Presentation presentation = new Presentation(
                Files.readAllBytes(path))) {

            // Create a slide and customize its title.
            Slide slide = new Slide(SlideLayoutType.TITLE);
            for(ShapeBase shapeBase : slide.getShapes()) {
                if(shapeBase instanceof Shape shape &&
                        shape.getPlaceholderSettings()
                                .getType() == PlaceholderType.CENTERED_TITLE) {
                    shape.getTextArea().setText("DevExpress Presentation API for Java");
                }
            }
            // Add the slide to the presentation.
            presentation.getSlides().add(slide);

            // Save the presentation while preserving PowerPoint compatibility.
            try (WritableByteChannel writableByteChannel =
                         FileChannel.open(path,
                              StandardOpenOption.WRITE,
                              StandardOpenOption.TRUNCATE_EXISTING)) {
                presentation.saveDocument(writableByteChannel);
            }
        }
    }
}
Copy
  • Java
import com.devexpress.docs.presentation.*;
import java.nio.channels.*;
import java.nio.file.*;

public class PresentationManagement {
    public static void main(String[] args) throws Exception {
        // Merge two speakers' decks into a single presentation.
        try(Presentation mergedPresentation = new Presentation()) {
            mergedPresentation.getSlides().clear();

            // Copy slides from both speaker presentations.
            appendSlides(mergedPresentation, Path.of("Speaker1.pptx"));
            appendSlides(mergedPresentation, Path.of("Speaker2.pptx"));

            try(Presentation teaserPresentation = new Presentation()) {
                // Create a teaser presentation with the first 3 slides.
                teaserPresentation.getSlides().clear();
                teaserPresentation.setSlideSize(mergedPresentation.getSlideSize());

                int teaserSlideCount = 3;
                for (int i = 0; i < teaserSlideCount; i++) {
                    Slide cloned = mergedPresentation.getSlides().get(i).deepClone();
                    teaserPresentation.getSlides().add(cloned);
                }

                // Save both presentations.
                try (WritableByteChannel mergedChannel =
                             FileChannel.open(Path.of("merged-presentation.pptx"),
                                  StandardOpenOption.CREATE,
                                  StandardOpenOption.WRITE,
                                  StandardOpenOption.TRUNCATE_EXISTING);
                     WritableByteChannel teaserChannel =
                             FileChannel.open(Path.of("teaser-presentation.pptx"),
                                  StandardOpenOption.CREATE,
                                  StandardOpenOption.WRITE,
                                  StandardOpenOption.TRUNCATE_EXISTING)) {

                    mergedPresentation.saveDocument(mergedChannel);
                    teaserPresentation.saveDocument(teaserChannel);
                }
            }
        }
    }

    static void appendSlides(Presentation destination, Path path) throws Exception {
        try (ReadableByteChannel channel =
                     Channels.newChannel(Files.newInputStream(path));
             Presentation source = new Presentation(channel, DocumentFormat.PPTX)) {

            for (Slide slide : source.getSlides()) {
                destination.getSlides().add(slide);
            }
        }
    }
}
Copy
  • Java
import com.devexpress.docs.*;
import com.devexpress.docs.office.*;
import com.devexpress.docs.presentation.*;
import com.devexpress.system.drawing.*;

import java.nio.channels.*;
import java.nio.file.*;

public class CreatePresentation {
    public static void main(String[] args) throws Exception {
        try (Presentation presentation = new Presentation()) {
            // Get the first slide.
            Slide slide = presentation.getSlides().getFirst();

            // Create a 5-point star shape. Set the shape's position and size.
            Shape shape = new Shape(ShapeType.getStar5(), 30, 30, 800, 800);

            // Create and configure the shape outline (stroke).
            LineStyle lineStyle = new LineStyle();
            lineStyle.setFill(new SolidFill(Color.getDarkRed()));
            lineStyle.setWidth(4);

            // Apply outline settings to the shape.
            shape.setOutline(lineStyle);

            // Set the fill color of the shape to coral.
            shape.setFill(new SolidFill(Color.getCoral()));

            // Configure visual effects. Create outer shadow effect.
            ShapeEffectProperties effects = new ShapeEffectProperties();

            OuterShadowEffect outerShadow = new OuterShadowEffect();
            outerShadow.setColor(new OfficeColor(Color.getGray()));
            outerShadow.setBlurRadius(50);
            outerShadow.setHorizontalScale(120);
            outerShadow.setVerticalScale(120);

            effects.setOuterShadow(outerShadow);

            // Apply effects to the shape.
            shape.setEffects(effects);

            // Add the configured shape to the slide.
            slide.getShapes().add(shape);

            // Save the presentation to a PPTX file.
            try (WritableByteChannel channel =
                     FileChannel.open(Path.of("presentation.pptx"),
                         StandardOpenOption.CREATE,
                         StandardOpenOption.WRITE,
                         StandardOpenOption.TRUNCATE_EXISTING)) {

                presentation.saveDocument(channel);
            }
        }
    }
}
Copy
  • Java
// Search presentation text, highlight matching words, replace specific text,
// and save the updated presentation.

import com.devexpress.docs.office.*;
import com.devexpress.system.drawing.*;
import com.devexpress.docs.presentation.*;

import java.nio.channels.*;
import java.nio.file.*;
import java.util.List;

public class ManagePresentationContent {
    public static void main(String[] args) throws Exception {
        String searchText = "keyword";
        String oldText = "original text";
        String newText = "replacement text";

        Path path = Path.of("presentation.pptx");

        try (Presentation presentation = new Presentation(Files.readAllBytes(path))) {
            // Configure search behavior.
            TextSearchOptions searchOptions = new TextSearchOptions();
            searchOptions.setMatchCase(false);
            searchOptions.setWholeWordOnly(true);

            // Define formatting applied to matched text.
            TextProperties textProperties = new TextProperties();
            textProperties.setFill(new SolidFill(Color.getYellow()));
            textProperties.setBold(true);

            for(Slide slide : presentation.getSlides()) {
                for (ShapeBase shapeBase : slide.getShapes()) {
                    if (shapeBase instanceof Shape shape) {
                        // Search all text in the current shape.
                        List<TextRange> searchResults =
                            shape.getTextArea()
                                    .findText(searchText, searchOptions);

                        // Apply formatting to each match.
                        for (TextRange match : searchResults) {
                            shape.getTextArea()
                                    .modifyTextProperties(match, textProperties);
                        }

                        // Replace matching text in the current shape.
                        shape.getTextArea()
                                .replaceText(oldText, newText, searchOptions);
                    }
                }
            }

            // Save the modified presentation.
            try (WritableByteChannel channel =
                     FileChannel.open(path,
                         StandardOpenOption.WRITE,
                         StandardOpenOption.TRUNCATE_EXISTING)) {

                presentation.saveDocument(channel);
            }
        }
    }
}
Copy
  • Java
// Exports a PowerPoint presentation to an encrypted PDF file
// with restricted permissions.

import com.devexpress.docs.pdf.*;
import com.devexpress.docs.presentation.*;
import com.devexpress.docs.presentation.exports.*;

import java.nio.channels.*;
import java.nio.file.*;

public class ExportPresentationToPdf {
    public static void main(String[] args) throws Exception {
        // Load the presentation.
        Path inputPath = Path.of("presentation.pptx");
        try (Presentation presentation =
                     new Presentation(Files.readAllBytes(inputPath))) {

            // Configure PDF encryption settings.
            EncryptionOptions encryptionOptions =
                new EncryptionOptions("OWNER_PASSWORD", "USER_PASSWORD");
            encryptionOptions.setAlgorithm(EncryptionAlgorithm.AES_256);
            encryptionOptions.setPrintPermissions(DocumentPrintPermissions.LOW_QUALITY);
            encryptionOptions.setModificationPermissions(
                DocumentModificationPermissions.NOT_ALLOWED);

            // Configure PDF export options.
            PdfExportOptions exportOptions = new PdfExportOptions();
            exportOptions.setEncryptionOptions(encryptionOptions);

            // Export the presentation to encrypted PDF.
            Path outputPath = Path.of("presentation.pdf");
            try(FileChannel outputChannel = FileChannel.open(
                    outputPath,
                    StandardOpenOption.CREATE,
                    StandardOpenOption.WRITE,
                    StandardOpenOption.TRUNCATE_EXISTING)) {

                presentation.exportToPdf(outputChannel, exportOptions);
            }
        }
    }
}
Copy

Barcode Generation API for Java

Generate and embed high-quality 1D and 2D barcodes in your Java applications and document workflows.

Barcode Types (Symbologies)

Generate popular 1D (EAN, UPC, Code 128, Code 39, ITF-14) and 2D (QR Code, Data Matrix, PDF417, Aztec) barcode types using intuitive fluent APIs. Configure both common and symbology-specific options to meet business requirements.

Custom Styling & Layout

Configure module size, margins, DPI, colors, and human-readable text. Fine-tune barcode appearance and layout while maintaining standards compliance and optimal readability.

High-Fidelity Output

Export barcodes to PNG, JPEG, SVG, or PDF with print-ready quality. Embed generated barcodes in documents, reports, labels, or application workflows with consistent rendering across environments.

  • Java
import com.devexpress.drawing.*;
import com.devexpress.docs.barcode.*;
import java.io.*;
import java.nio.file.*;

public class GenerateBarcode {
    public static void main(String[] args) throws Exception {

        byte[] logoBytes = Files.readAllBytes(Path.of("images/devexpress-logo.png"));
        try (DXImage logo = DXImage.fromStream(new ByteArrayInputStream(logoBytes))) {
            QRCodeOptions options = new QRCodeOptionsBuilder()
                .withCompactionMode(QRCodeCompactionMode.BYTE)
                .withVersion(QRCodeVersion.VERSION_10)
                .withErrorCorrectionLevel(QRCodeErrorCorrectionLevel.H)
                .withModuleSize(10)
                .withShowText(false)
                .withIncludeQuietZone(true)
                .withLogo(logo)
                .build();

            try (FileOutputStream pngStream = new FileOutputStream(
                    Path.of("qr-code.png").toFile());
                 BarcodeGenerator generator = new BarcodeGenerator(options)) {
                // Export the QR Code to a PNG image.
                generator.export("https://www.devexpress.com", pngStream, DXImageFormat.getPng());
            }
        }
    }
}
Copy

Best in Class Tools

DevExpress is honored to have been voted best in class 16 times in this year's Visual Studio Magazine Reader's Choice Awards.

Experience the DevExpress difference and see why your peers consistently vote our products #1. With our Universal Subscription, you will build your best, see complex software with greater clarity, increase your productivity and create stunning applications for Windows, Web and your Mobile world.

16 VSM Awards in 2025 x16
18 VSM Awards in 2024 x18
19 VSM Awards in 2023 x19
20 VSM Awards in 2022 x20

Frequently Asked Questions

Common Questions (All Products)

How is Office & PDF File API for Java licensed?

The DevExpress Office & PDF File API for Java is currently available free of charge.

You can download and use API libraries at no cost. Future licensing terms may change as the product evolves.

What Java versions are supported?

The DevExpress Office & PDF File API for Java is designed for Java 21 and newer. API libraries integrate seamlessly with Maven, Gradle, and modern Java IDEs.

Is Office & PDF File API for Java cloud-ready?

Yes. The DevExpress Office & PDF File API for Java is a lightweight, server-side library with no Microsoft Office or Adobe Acrobat dependencies. It can be deployed in cloud environments, containerized applications, microservices, and traditional Java server applications.

PDF Document API for Java

How do I get started with the PDF Document API for Java?

Add the DevExpress PDF Document API dependency to your Maven or Gradle project, create a PdfDocument instance, and begin creating or modifying PDF files programmatically.

The online documentation includes step-by-step tutorials, code examples, and API reference topics to help you get started quickly.

What can I do with the PDF Document API for Java?

The DevExpress PDF Document API for Java allows you to create, load, modify, save, and manipulate PDF documents programmatically. You can do the following:

  • Generate PDFs from scratch with text, graphics, and images
  • Merge and split PDF files
  • Add watermarks and annotations
  • Create and fill interactive forms (AcroForms)
  • Encrypt and protect PDFs
  • Extract text and images
  • Work with attachments and metadata
  • Generate PDF/UA-compliant (tagged) documents
  • Convert PDF pages to images
  • Create ZUGFeRD-compliant invoices
Is Adobe Acrobat® required to create PDFs with the DevExpress PDF Document API for Java?

No. You do not need to install Adobe Acrobat® or Adobe Reader® to generate or manipulate PDF files. The DevExpress PDF Document API for Java is a standalone library that creates and processes PDF documents programmatically.

PowerPoint Presentation API for Java

How do I get started with the Presentation API for Java?

Add the DevExpress Presentation API dependency to your Maven or Gradle project, create a Presentation instance, and start generating or modifying PowerPoint presentations in code.

The online documentation includes tutorials, code examples, and API reference topics for common presentation tasks.

Is Microsoft PowerPoint® required to create presentations with the Presentation API for Java?

No. You do not need to install Microsoft PowerPoint® to generate or manipulate PPTX, PPTM, POTX, or POTM files. The DevExpress Presentation API for Java is a standalone library that creates and processes presentations programmatically.

What can I do with the Presentation API for Java?

The DevExpress Presentation API for Java allows you to create, load, modify, save, and export presentations programmatically. You can manage slide masters and layouts, add shapes, text, images, charts, and tables, apply themes and formatting, search and replace text content, merge and split presentations, and export presentations to PDF and image formats.

Barcode Generation for Java

How do I get started with the Barcode Generation API for Java?

Add the DevExpress Barcode Generation API dependency to your Maven or Gradle project, create a BarcodeGenerator instance, configure barcode options, and export the generated barcode to an image or PDF file.

The online documentation includes examples for all supported barcode symbologies and customization options.

What can I do with the Barcode Generation API for Java?

The DevExpress Barcode Generation API for Java allows you to create and customize 1D and 2D barcodes programmatically. You can generate popular barcode symbologies (such as EAN, UPC, Code 128, QR Code, Data Matrix, PDF417, and Aztec), configure barcode-specific settings, customize appearance and layout, and export barcodes to PNG, JPEG, SVG, or PDF formats. Generated barcodes can be embedded into documents, reports, and business applications.