Newbie questions

  • Hi,

    I'm currently evaluating your wPDFControl product. I have the following questions (DLL demo version 2.3.7.1).

    1) I'm using MS Visual C++ 6.0 with MFC. I include "wpdf_class.h". However there is an error. CPDFExport::RichEditPrint is not defined in the class definition and the implementation uses wpdfOutline in stead of wpdfRichEditPrint.

    2) Im using CPDFExport::DC() to redirect my printing code to the PDF engine. However a BitBlt of an image results in a black picture. StretchBlt however does work correctly.

    3) Is there any other way to control the output dpi of the PDF file? The dpi seems to be from the dpi of the active printer?

    Thanks

    • Offizieller Beitrag

    Hi,

    RichEditPrint is not defined in the class - it was added later.

    It is defined as follows:
    void stdcall WPDF_RichEditPrint(int env: pdfEnviroment,
    long RichEditHandle
    float PageWidth, float PageHeight, float LeftMargin, float TopMargin, float RightMargin, float BottomMargin: Single;
    bool UseCM);

    But it was mainly created for visual basic anywas, in C++ you can do it better in your own code.

    In general it uses
    SendMessage(RichEditHandle, EM_FORMATRANGE, 0, 0); to print the text to thd 'DC'.

    >>2) Im using CPDFExport::DC() to redirect my printing code to the PDF engine. However a BitBlt of an image results in a black picture. StretchBlt however does work correctly. <<

    Please always use StrecthBlt for pictures.

    >>3) Is there any other way to control the output dpi of the PDF file? The dpi seems to be from the dpi of the active printer? <<

    Yes. Use SetViewPort API with the DC. This will change the resolution, also of the created PDF file.

    Julian Ziersch

  • Thanks for the answer.

    In the meantime I have purchased a license. But still some questions remain.

    1) I'm not using the RichEdit stuff. I just mention that the source code you have suplied does not compile because it contains errors. I you want an corrected version, I'm happy to mail it to you.

    2) OK

    3) Can you give me detailed info on which functions to use and how to use them. Do I use them on the pdf DC or on the printer DC? How do I set a specific dpi value for the DC when creating the pdf file. I have tried several Viewport API functions but was not able to get a new dpi setting for the DC.

    I have noticed that the demo version of wPDFControlDemo.dll is 2.3.7.1 and the version of wPDFControl02.dll is 2.3.7.0. I have encountered a difference in DC handling with the two versions when using the same code to create the pdf file. The demo version behavious OK: that is the pdf DC is based on the printer settings (300dpi). However wPDFControl02 always uses the screen DC (96dpi). In addition on my Win98 test PC the DC function return 0 while on my dev PC (Win2000) is returns a screen DC. Is there an update of the DLL available that fixes these problems?

    Thanks

    • Offizieller Beitrag

    Hi,

    >> 1) I'm not using the RichEdit stuff. I just mention that the source code you have suplied does not compile because it contains errors. I you want an corrected version, I'm happy to mail it to you. <<

    Yes, I am interested.

    >>3) Can you give me detailed info on which functions to use and how to use them. Do I use them on the pdf DC or on the printer DC? How do I set a specific dpi value for the DC when creating the pdf file. I have tried several Viewport API functions but was not able to get a new dpi setting for the DC. <<

    No SetViewPort API call will change the physical resolution (GetDeviceCaps ...) - they all change only the logical resolution and this works ok with the PDF engine.

    >> I have noticed that the demo version of wPDFControlDemo.dll is 2.3.7.1 and the version of wPDFControl02.dll is 2.3.7.0. I have encountered a difference in DC handling with the two versions when using the same code to create the pdf file. The demo version behavious OK: that is the pdf DC is based on the printer settings (300dpi). However wPDFControl02 always uses the screen DC (96dpi). In addition on my Win98 test PC the DC function return 0 while on my dev PC (Win2000) is returns a screen DC. Is there an update of the DLL available that fixes these problems?<<

    Probably a compiler switch was set differently.

    You can explizitely select the printer DC to be using the bit 4 (value 8) in the InfoRect.EnhancedOptions
    -or-
    wpdfSetIProp( env, WPPDF_EnhancedOptions, 8);

    Julian Ziersch

  • OK source code is on the way.

    I abbandoned the vieport stuff. I'm happy with the screen and printer resolutions as it is now.

    I actually did get an update from you guys. wPDFControl02.dll 2.4.0.0 solved the problem.