Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PDFCLOUD-2446 Create two pdfRest Java code samples #42

Merged

Conversation

datalogics-kam
Copy link
Member

@datalogics-kam datalogics-kam commented Sep 8, 2023

PDFCLOUD-2446

  • Java samples for CompressedPdf and MergePdf
  • pom.xml file that functions as sort of a universal project format; should work with IntelliJ IDEA (developed with) but also Visual Studio Code, Eclipse, or NetBeans.
  • IntelliJ IDEA project with some settings in it.
  • Uses Spotless as a one-stop-shop for Java and Maven formatting and linting.
  • GitHub Action that runs the verify phase in Maven for pull requests and the main branch.

See the README.md in the Java/Single Calls directory for more information on how to use these samples.

The two samples will be

  • CompressedPdf
  • MergedPdf

Some deviation from the patterns in the other tests:

  • Java source files have to be named the same as the class they contain, or they won't compile. Therefore compressed-pdf.java was right out; in this case, I just went.

Deviations from normal Maven projects:

  • Forced the source code into the top level and removed package statements, otherwise the sources would be in src/main/java/org/example.
  • This kind of tilts the brain of the IDE, so we won't be able to keep this up if we add tests.

Improvements:

  • Files can be specified as command line arguments.
  • API key can be specified in an .env file to avoid placing it into source code.

@datalogics-kam datalogics-kam force-pushed the pdfcloud-2446-java-samples branch from 6f8a856 to 649454b Compare September 8, 2023 22:57
@datalogics-kam datalogics-kam force-pushed the pdfcloud-2446-java-samples branch 6 times, most recently from 1b3d154 to ba8d1ea Compare September 11, 2023 17:18
@datalogics-kam datalogics-kam force-pushed the pdfcloud-2446-java-samples branch from ba8d1ea to 41792a2 Compare September 11, 2023 21:27
@datalogics-kam datalogics-kam marked this pull request as ready for review September 11, 2023 21:28
Copy link
Contributor

@datalogics-dliang datalogics-dliang left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Followed the instructions in the README for running from IntelliJ IDEA and the samples ran as expected.

Copy link
Contributor

@datalogics-jacksonm datalogics-jacksonm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No notes! Works great

Copy link
Contributor

@datalogics-cgreen datalogics-cgreen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very nifty!

@datalogics-cgreen datalogics-cgreen merged commit aa6a007 into datalogics:main Sep 15, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants