mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2025-06-20 17:17:13 +02:00
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.
This commit is contained in:
39
vendor/POCO/PDF/samples/Template/src/Template.cpp
vendored
Normal file
39
vendor/POCO/PDF/samples/Template/src/Template.cpp
vendored
Normal file
@ -0,0 +1,39 @@
|
||||
//
|
||||
// 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;
|
||||
}
|
Reference in New Issue
Block a user