1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-04-16 17:27:13 +02:00
Sandu Liviu Catalin 4a6bfc086c Major plugin refactor and cleanup.
Switched to POCO library for unified platform/library interface.
Deprecated the external module API. It was creating more problems than solving.
Removed most built-in libraries in favor of system libraries for easier maintenance.
Cleaned and secured code with help from static analyzers.
2021-01-30 08:51:39 +02:00

40 lines
859 B
C++

//
// main.cpp
//
#include "Poco/PDF/XMLTemplate.h"
#include "Poco/Path.h"
#include "Poco/File.h"
#include "Poco/Exception.h"
#include <iostream>
#if defined(POCO_OS_FAMILY_UNIX)
const std::string pdfFileName = "${POCO_BASE}/PDF/samples/Template/Report.pdf";
const std::string xmlFileName = "${POCO_BASE}/PDF/samples/Template/Template.xml";
#elif defined(POCO_OS_FAMILY_WINDOWS)
const std::string pdfFileName = "%POCO_BASE%/PDF/samples/Template/Report.pdf";
const std::string xmlFileName = "%POCO_BASE%/PDF/samples/Template/Template.xml";
#endif
using Poco::Path;
using Poco::File;
int main(int argc, char** argv)
{
try
{
Poco::PDF::XMLTemplate xmlTemplate(Path::expand(xmlFileName));
xmlTemplate.create(Path::expand(pdfFileName));
}
catch (Poco::Exception& exc)
{
std::cerr << "ERROR: " << exc.displayText() << std::endl;
}
return 0;
}