# allenrichi/adobe-pdf-library-samples architecture

> Architecture diagram of the GitHub repository allenrichi/adobe-pdf-library-samples, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-02-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/allenrichi/adobe-pdf-library-samples
- Repository: https://github.com/allenrichi/adobe-pdf-library-samples

## Overview

Below are detailed guidelines tailored to this project:

##### Project Type and Purpose
- The purpose of the project is to demonstrate how to use the Adobe PDF Library through sample code.
- It is not a full production system but rather a “sample suite” for Datalogics prospects and customers.
- The repository is structured into three major language directories: CPlusPlus, DotNET, and Java. Each one contains further modules demonstrating specific PDF functionalities.

##### File Structure
- Notice the top-level directories: “CPlusPlus”, “DotNET”, and “Java”. These represent three different client interfaces to the Adobe PDF Library.
- Within each language directory, there are subdirectories such as “Annotations”, “ContentCreation”, “ContentExtraction”, “ContentModification”, “Display”, “DocumentConversion”, “DocumentOptimization”, “Security”, “Text”, “Images”, etc. These clearly represent functional modules.
- The “Sample_Input” directory contains various PDF and image files used as test data for the samples.
- Each module typically includes project files (e.g., Visual Studio solutions and projects for C++ and .NET, and source folders structured in packages for Java).

##### Core Components and Their Relationships
- Main Components:
- The language-specific sample applications:
- C++ Samples: Organized by functional modules (Annotations, ContentCreation, etc.) that demonstrate interactions with the Adobe PDF Library.
- .NET Samples: Same functional organization, typically with Windows Forms and other .NET project types.
- Java Samples: Organized in package structures (e.g., “com/datalogics/PDFL/Samples”) for each functionality like annotations, document conversion, and so on.
- The Adobe PDF Library itself is the underlying “service” that these samples demonstrate. Although it is not part of the repository’s code, it is the API that these samples consume.
- Auxiliary Components: The Sample_Input data repository which provides the PDF/documents and images for testing sample functionalities.
- Interactions:
- Each sample application (regardless of language) calls the corresponding API functions in the Adobe PDF Library.
- Within each language stack, the functional modules are self-contained but may share common helper code (for example, the “_Common” folder in C++ and any shared libraries in Java or .NET).

##### Architectural Patterns and Design Principles
- Reusability: Common code (e.g., _Common in C++) is used across the sample modules; show this as a shared component that supports different modules.
- Demo/Integration Layer: The sample input data is the common resource for testing; include it to indicate input flow to each module.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Components
    A_PDF["Adobe PDF Library"]:::external
    InputData["Sample Input Data"]:::data

    %% C++ Samples Subgraph
    subgraph "C++ Samples"
        direction TB
        CPP["C++ Samples"]:::language
        CPP_A["Annotations"]:::module
        CPP_CC["Content Creation"]:::module
        CPP_CE["Content Extraction"]:::module
        CPP_CM["Content Modification"]:::module
        CPP_D["Display"]:::module
        CPP_DC["Document Conversion"]:::module
        CPP_DO["Document Optimization"]:::module
        CPP_S["Security"]:::module
        CPP_T["Text Processing"]:::module
        CPP_Common["Common Helper Code"]:::module
    end

    %% .NET Samples Subgraph
    subgraph ".NET Samples"
        direction TB
        DotNET[".NET Samples"]:::language
        DotNET_A["Annotations"]:::module
        DotNET_CC["Content Creation"]:::module
        DotNET_CM["Content Modification"]:::module
        DotNET_D["Display"]:::module
        DotNET_DC["Document Conversion"]:::module
        DotNET_DO["Document Optimization"]:::module
        DotNET_F["Forms"]:::module
        DotNET_Img["Images"]:::module
        DotNET_IE["Information Extraction"]:::module
        DotNET_P["Printing"]:::module
        DotNET_S["Security"]:::module
        DotNET_T["Text"]:::module
        DotNET_Other["Other"]:::module
    end

    %% Java Samples Subgraph
    subgraph "Java Samples"
        direction TB
        Java["Java Samples"]:::language
        Java_A["Annotations"]:::module
        Java_CC["Content Creation"]:::module
        Java_CM["Content Modification"]:::module
        Java_D["Display"]:::module
        Java_DC["Document Conversion"]:::module
        Java_DO["Document Optimization"]:::module
        Java_S["Security"]:::module
        Java_T["Text"]:::module
        Java_Other["Other"]:::module
        Java_P["Printing"]:::module
        Java_OCR["Optical Character Recognition"]:::module
        Java_Common["Common Shared Code"]:::module
    end

    %% Relationships from Language Suites to Adobe PDF Library and Sample Input Data
    CPP -->|"callsAPI"| A_PDF
    DotNET -->|"callsAPI"| A_PDF
    Java -->|"callsAPI"| A_PDF

    CPP <-->|"dataFlow"| InputData
    DotNET <-->|"dataFlow"| InputData
    Java <-->|"dataFlow"| InputData

    %% Click Events for C++ Samples
    click CPP "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source"
    click CPP_A "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/Annotations"
    click CPP_CC "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/ContentCreation"
    click CPP_CE "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/ContentExtraction"
    click CPP_CM "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/ContentModification"
    click CPP_D "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/Display"
    click CPP_DC "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/DocumentConversion"
    click CPP_DO "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/DocumentOptimization"
    click CPP_S "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/Security"
    click CPP_T "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/Text"
    click CPP_Common "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/CPlusPlus/Sample_Source/_Common"

    %% Click Events for .NET Samples
    click DotNET "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source"
    click DotNET_A "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Annotations"
    click DotNET_CC "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/ContentCreation"
    click DotNET_CM "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/ContentModification"
    click DotNET_D "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Display"
    click DotNET_DC "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/DocumentConversion"
    click DotNET_DO "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/DocumentOptimization"
    click DotNET_F "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Forms"
    click DotNET_Img "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Images"
    click DotNET_IE "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/InformationExtraction"
    click DotNET_P "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Printing"
    click DotNET_S "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Security"
    click DotNET_T "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Text"
    click DotNET_Other "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/DotNET/Sample_Source/Other"

    %% Click Events for Java Samples
    click Java "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source"
    click Java_A "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/Annotations"
    click Java_CC "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/ContentCreation"
    click Java_CM "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/ContentModification"
    click Java_D "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/Display"
    click Java_DC "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/DocumentConversion"
    click Java_DO "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/DocumentOptimization"
    click Java_S "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/Security"
    click Java_T "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/Text"
    click Java_Other "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/Other"
    click Java_P "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/Printing"
    click Java_OCR "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/OpticalCharacterRecognition"
    click Java_Common "https://github.com/allenrichi/adobe-pdf-library-samples/tree/master/Java/Sample_Source/samples-common"

    %% Styles
    classDef language fill:#ADD8E6,stroke:#333,stroke-width:2px;
    classDef module fill:#C1FFC1,stroke:#2F4F4F,stroke-width:1px;
    classDef external fill:#FFA07A,stroke:#8B0000,stroke-width:2px;
    classDef data fill:#FFFF99,stroke:#B8860B,stroke-width:2px;
```
