Skip to content

Latest commit

 

History

History
21 lines (17 loc) · 922 Bytes

README.md

File metadata and controls

21 lines (17 loc) · 922 Bytes

Java native interface pdf writer.

A sample java program for interaction of java with native language such as C/C++ to create a pdf file.

How to build and execute?

  1. Run the following command to create header PdfWriter.h file with the native method declarations in it.
    javac -h . Main.java
  1. Use the header files and shared library from PDFWriter project to define the methods in PdfWriter.h header files.

  2. Run the following command to create a shared library to be used for java native interface

g++ -shared PdfWriter.cpp -I {Path to PDFWriter includes} -L {Path to PDFWriter shared library} -l pdfwriter -I JAVA_HOME/java-14-openjdk-amd64/include -I JAVA_HOME/java-14-openjdk-amd64/include/linux -o libpdf.so -fPIC
  1. Add the library generated libpdf.so to library path.
  2. Running the java file
java Main