Convert OFD, EPS, and PCL to PDF in C++
Contents
[
Hide
]
Load OFD, EPS, and PCL files with format-specific options and save them as PDF.
Configure the Aspose.PDF for C++ SDK before running these functions. Pass an existing input file and a writable destination path; create any required output directories first. Each function is an independent example, and its options do not carry over to other examples.
For text, LaTeX, Markdown, PostScript, XPS, and XML with XSL-FO, see Convert Other File Formats to PDF.
Convert OFD to PDF
Use OfdLoadOptions to load the OFD document.
- Create OfdLoadOptions.
- Load
inputFileinto a Document using the load options. - Save the result with Document::Save().
#include <Aspose.PDF.Cpp/Document.h>
#include <Aspose.PDF.Cpp/OFD/OfdLoadOptions.h>
namespace ConvertingExamples
{
using namespace System;
using namespace Aspose::Pdf;
void ConvertOfdToPdf(String inputFile, String outputFile)
{
auto options = MakeObject<OfdLoadOptions>();
auto document = MakeObject<Document>(inputFile, options);
document->Save(outputFile);
}
}
Convert EPS to PDF
Use PsLoadOptions to load the Encapsulated PostScript document.
- Create PsLoadOptions.
- Load
inputFileinto a Document using the load options. - Save the result with Document::Save().
#include <Aspose.PDF.Cpp/Document.h>
#include <Aspose.PDF.Cpp/PsLoadOptions.h>
namespace ConvertingExamples
{
using namespace System;
using namespace Aspose::Pdf;
void ConvertEpsToPdf(String inputFile, String outputFile)
{
auto options = MakeObject<PsLoadOptions>();
auto document = MakeObject<Document>(inputFile, options);
document->Save(outputFile);
}
}
Convert PCL to PDF
Set PclLoadOptions::SupressErrors to true before loading the PCL file. The supplied example suppresses PCL conversion errors.
- Create PclLoadOptions.
- Set
SupressErrorstotruein PclLoadOptions. - Load
inputFileinto a Document using the load options. - Save the result with Document::Save().
#include <Aspose.PDF.Cpp/Document.h>
#include <Aspose.PDF.Cpp/PclLoadOptions.h>
namespace ConvertingExamples
{
using namespace System;
using namespace Aspose::Pdf;
void ConvertPclToPdf(String inputFile, String outputFile)
{
auto options = MakeObject<PclLoadOptions>();
options->SupressErrors = true;
auto document = MakeObject<Document>(inputFile, options);
document->Save(outputFile);
}
}