Convert Conformance
A complete, runnable cpp program — 17 lines, shipped in your download.
Demonstrates PDF/A & Conformance
Same example, other languages: activex_cpp c cpp_linux csharp python vbnet
examples/cpp/convert_conformance/convert_conformance.cpp
17 lines
// convert_conformance -- C++ port: plain PDF -> PDF/A and PDF/X, each a SINGLE method call.
#include <lumaspdf.h>
#include <cstdio>
int main(void){
PPDF p = pdfNewPDF();
int a = pdfConvertFileA(p, "../../test_files/plain.pdf", "out_pdfa.pdf",
ctPDFA_2b, 0, "../../test_files/sRGB.icc",
"../../test_files/ISOcoated_v2_bas.ICC", NULL, NULL, NULL, NULL);
printf("plain -> PDF/A (ctPDFA_2b) rc=%d\n", a);
int x = pdfConvertFileA(p, "../../test_files/plain.pdf", "out_pdfx.pdf",
ctPDFX_4, 0, "../../test_files/sRGB.icc",
"../../test_files/ISOcoated_v2_bas.ICC", NULL, NULL, NULL, NULL);
printf("plain -> PDF/X (ctPDFX_4) rc=%d\n", x);
pdfDeletePDF(p);
return (a < 0 || x < 0) ? 1 : 0;
}
This file is in the SDK at examples/cpp/convert_conformance/convert_conformance.cpp.
The build fails if this page and that file ever differ.