Qt proj and PDFCreator from Amyuni



  • Hi guys,
    First of all I want to know you I am beginer with Qt proj.
    So I need to implement Amyuni PDF library to existing Qt proj.
    So in documentation they say I can use Amyuni PDFCreator as library
    without using their PDFCreator control which is an activeX control.
    So here in documentation they said that:
    https://www.amyuni.com/WebHelp/Developer_Documentation.htm#Amyuni_PDF_Creator_for_ACTIVE_X/About/Legal_Information.htm

    (BTW I using C++ and MS Visual Studio 2013)
    My questions are:

    1. How can I import their dll elegantly without using #import "/pathToTheDLl"
      to my Qt project.
    2. Why they generate that 2 additional dlls. Do I need them at all?
      2.5 Importing their dll means that I actually using their library ?

    THANK YOU ALL IN ADVANCE


  • Moderators

    @Tony123 You should start with http://doc.qt.io/qt-5/third-party-libraries.html

    What is "#import "/pathToTheDLl""? Do you mean #include <...>?
    Sure you need to include header files which you need to use.
    I don't know whether you need both DLLs, that you need to check or ask them.

    "Importing their dll means that I actually using their library" - no, it only means that your app will depend on those DLLs. To use them you need to use the functionality provided by those DLLs (call their functions, use their classes,...).



  • Thank you for your quick answer @jsulm .
    #import is a way to import your dll with hardcode, thats why I ask if I can set the dll somewhere in Qt proj.
    Only thing I have is a dll file. I have no headers or lib files. Thats why I am confused.


  • Moderators

    @Tony123 It actually looks like .Net and UWP library not C++: https://www.amyuni.com/de/developer/pdfcreator/features/
    You could try to use the UWP version of that library. For that you need to install UWP Qt 5.9 version (currently beta).
    Also: it looks like it is commercial and costs money! https://www.amyuni.com/en/developer/pdfcreatoruwp/pricing/
    Cost per Developer License
    $ 529 USD

    Cost per Application License
    $ 799 USD

    Maintenance
    $ 519 USD



  • @jsulm It can be used in C++ enviroment if you download this product PDFCreator for ActiveX. See documentation:

    https://www.amyuni.com/WebHelp/Developer_Documentation.htm#Amyuni_PDF_Creator_for_ACTIVE_X/About/Legal_Information.htm

    . On left side navigate to Overview-> Inserting PDFCreator Control into a Project-> Using a PDFCreator in a C++ Project

    Money doesnt matter here. Just make it work.


  • Moderators

    @Tony123 Well I'm not an expert with all that proprietary Microsoft stuff (like #import - this isn't part of C++ standard).
    So, I cannot help here. Maybe somebody else can.



  • @Tony123 said:

    So in documentation they say I can use Amyuni PDFCreator as library without using their PDFCreator control which is an activeX control.

    On left side navigate to Overview-> Inserting PDFCreator Control into a Project-> Using a PDFCreator in a C++ Project

    It does not. The first comment in the documentation you linked reads Register the ActiveX COM control

    You can use it as a .Net library using C++/CLI. To enable it in a qmake project add the following lines to your .pro file:

    QMAKE_CXXFLAGS += -clr
    QMAKE_CXXFLAGS_STL_ON -= -EHsc
    QMAKE_CXXFLAGS_EXCEPTIONS_ON -= -EHsc
    

    for CMake see http://stackoverflow.com/questions/40126734/set-clr-support-to-true-with-cmake
    Note that the above will apply to all source files in your project. You need Visual Studio to make it apply to a single source file only.

    After that you can use the #import syntax as well as any other C++/CLI keywords and follow the example in On left side navigate to Overview-> Inserting PDFCreator Control into a Project->Using PDF Creator as a DLL in .Net -> C++

    Sometimes there are some compatibility issue between Qt and CLR. at the moment a known bug is in QStateMachine



  • @VRonin Ok, You just confused me more and more :).
    I dont know what is Qmake or Cmake or how can these help me.
    I am already able to #import that dll and make it work with activeX control in my Qt project. I mean I just create a Qt proj added this line and also added QAxWidget:

    // imported that dll
    #import "C:\Program Files\Amyuni PDF Suite\PDFCreactiveX.dll" no_namespace /*raw_interfaces_only*/
    
     IPDFCreactiveXPtr pdf;
     
    //Create the PDFCreactiveX instance
     pdf.CreateInstance(__uuidof(PDFCreactiveX));
    
    pdf. DO_STUFFS
    
    

    boom here we go!
    But my question are:

    1. Is there any, more elegant way to import that file.? Like in Project properties or I dont know?
    2. I'm just curious if I do it right. Because my only task is in existing Qt project use the Amyuni PDF
      library instead of QuckPDF library.

    Thanks dont over complicate it pls. Maybe if you sent me a sample it would be more efficient if I missing something.

    Big thanks !!



  • @Tony123 said in Qt proj and PDFCreator from Amyuni:

    Is there any, more elegant way to import that file.? Like in Project properties or I dont know?

    in visual studio, right click on the project -> properties -> Common Properties -> References -> add new reference -> browse

    You still need the #import "PDFCreactiveX.dll" on top though

    I'm just curious if I do it right. Because my only task is in existing Qt project use the Amyuni PDF library instead of QuckPDF library.

    Quickly looking at that documentation I'd say this is the way to go. Up to you to decide if linking to .Net is acceptable for your project


Log in to reply