PDF OCG Context : impossible to find override function

Product: PDF OCG Context : impossible to find override function ‘pdftron::PDF::OCG::Context

Product Version: C++ (64-bit) Version: 11.12.1 (Latest),

Please give a brief summary of your issue:

My program is on c++ 14.
After download and follow you’r instruction, and follow sample conversion doc to pdf, my program does’t compile, with an error with your ocg context.

Please describe your issue and provide steps to reproduce it:
Juste follow sample convertion doc to pdf (.pptx to .pdf). i use this function : pdftron::PDF::Convert::OfficeToPDF

Please provide a link to a minimal sample where the issue is reproducible:

pdftron::PDFNet::Initialize(“demo:xxx”);    
pdftron::PDF::PDFDoc lDoc;

    pdftron::UString lUInputFile = pdftron::UString(lInputFile);
    pdftron::UString lUOutputFile = pdftron::UString(lOutFile);

    pdftron::PDF::Convert::OfficeToPDF(lDoc, lUInputFile, NULL);
    lDoc.Save(lUOutputFile, pdftron::SDF::SDFDoc::e_linearized, NULL);

    pdftron::PDFNet::Terminate();

Thank you for contacting us about this. I tried running our Office to PDF sample using C++ 14 on Linux (Ubuntu WSL) and did not run into any compilation errors. It is possible that this issue is due to our different environments.

Are you able to provide us with a sample project along with your environment information (ie. Windows, Linux, x64 or arm64) in order for us to better reproduce the condition? Please also provide us with the detailed compilation error as well.

Hi, thank you for your replay.

I’m running Windows x64 with Qt 5.15. My program uses a DLL, but when i tried to integrate the SDK directly into that DLL; i encountered OCG Content override in compilation error. So i created an intermediate DLL that encapsulates the SDK, and i call it from my original DLL.

Everything works fine. I checked the configurations of both projects and they are identical, this maybe due to context conflicts or preprocessor errors.

1 Like

Thank you for letting us know. Wrapping the API in another DLL can lead to further complications. Please let us know if you have any further questions/issues.

1 Like