Selaa lähdekoodia

adding PDFHummus test to try using the library. there were some problems.

wes 5 vuotta sitten
vanhempi
commit
027c703062
2 muutettua tiedostoa jossa 17 lisäystä ja 1 poistoa
  1. 3 1
      Makefile
  2. 14 0
      pdfHummusTest1.cpp

+ 3 - 1
Makefile

@@ -30,4 +30,6 @@ libharuEXMP.exe : libharuEXMP.cpp libharuEXMP/libpng16.dll libharuEXMP/libhpdf.d
 %.dll : 
 	copy $(ow)\bin\$(@F) "$(@D)\"
 cleanPDFtest.exe : cleanPDFtest.cpp cleanPDFtest/libpng16.dll cleanPDFtest/libhpdf.dll
-	g++ $< -L $(ow)/lib/  -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
+	g++ $< -L $(ow)/lib/  -I $(ow)/include/ -lhpdf -o $(basename $@)/$@
+pdfHummusTest1.exe : pdfHummusTest1.cpp
+	g++ $< -I "C:\Program Files (x86)\PDFHUMMUS\include" -L "C:\Program Files (x86)\PDFHUMMUS\lib" -lPDFWriter -o $(basename $@)/$@

+ 14 - 0
pdfHummusTest1.cpp

@@ -0,0 +1,14 @@
+/*  Found that previous library was complied with the MSVC compiler and not compatible with GNU toolchain. Tried to use Msys with PDFHummus Cmake build tools and it was hard-coded
+ *  to MSVC. So building for GNU compiler will take some modification of Cmake.
+ */
+
+#include <stdlib.h>
+#include <iostream>
+#include "PDFWriter/PDFWriter.h"
+
+int main(){
+    PDFWriter pdfWriter;
+    pdfWriter.StartPDF("c:\\myFile.pdf",ePDFVersion13);
+    // ...add content to PDF file...
+    pdfWriter.EndPDF();
+}