Skip to content

Instantly share code, notes, and snippets.

@terjehelgesen
terjehelgesen / convert-dwf-to-pdf.cs
Last active August 16, 2024 11:01
Convert DWF to PDF in C# using scConverter
//scConverter Sample Code
//Read more about scConverter online: http://www.softwarecompanions.com/scconverterdll.html
{
scConverterLib.Converter myconverter = new scConverterLib.Converter();
if (myconverter != null)
{
myconverter.SetSerialNumber("Your Serial Number");
//Select PDF/A-4e as standard for output
myconverter.PDFWriteFormat = 7;
@terjehelgesen
terjehelgesen / convert-pdf-to-pdfa.cs
Last active August 16, 2024 11:01
Convert a PDF file to PDF/A standard using C#
//scConverter Sample Code
//Read more about scConverter online: http://www.softwarecompanions.com/scconverterdll.html
{
scConverterLib.Converter myconverter = new scConverterLib.Converter();
if (myconverter != null)
{
string errors = "";
myconverter.SetSerialNumber("Your Serial Number");
//Convert input file to PDF-A/4
@terjehelgesen
terjehelgesen / convert-pdf-to-pdfa.cpp
Last active August 14, 2024 20:01
Convert a PDF file to PDF/A standard using C++
int ConvertPDFtoPDFA( WCHAR *SerialNumber, WCHAR *InputFile, WCHAR *OutputFile, int ConformStandard, BSTR *bstrErrors)
{
//Declare Conform function
typedef int ( *SC_CONFORM_FILE)(WCHAR *SerialNumber, WCHAR *InputFileName, int ConformStandard, WCHAR *OutputFileName, BSTR *Errors);
//Load scConverter.dll
HINSTANCE hLib = LoadLibraryExW( L"scConverter.dll", nullptr, LOAD_WITH_ALTERED_SEARCH_PATH );
if (!hLib) return -1;
//Get Conform function pointer