locked
Printer control function

    Question

  • 	
    	    D2D1_PRINT_CONTROL_PROPERTIES printControlProperties;
    printControlProperties.rasterDPI = 150.0f; // Use the default rasterization DPI for all unsupported Direct2D commands 
    																																											//	or options.
    printControlProperties.fontSubset = D2D1_PRINT_FONT_SUBSET_MODE_DEFAULT; // Using the default font subset strategy.
    printControlProperties.colorSpace = D2D1_COLOR_SPACE_SRGB; // Color space for vector graphics in Direct2D print control.
    
    
     m_d2dPrintControl = nullptr;
    
     IPrintDocumentPackageTarget* documentTarget;
    
     documentTarget=nullptr;
    
       Microsoft::WRL::ComPtr<IPrintPreviewDxgiPackageTarget>  m_dxgiPreviewTarget;
    
      HRESULT hr = (documentTarget != nullptr) ? S_OK : E_INVALIDARG;
    
        // Get for IPrintPreviewDxgiPackageTarget interface.
        if (SUCCEEDED(hr))
        {
            hr = documentTarget->GetPackageTarget(
                ID_PREVIEWPACKAGETARGET_DXGI,
                IID_PPV_ARGS(&m_dxgiPreviewTarget)
                );
        }
    
    
    m_d2dDevice->CreatePrintControl(
         m_wicFactory.Get(),
        documentTarget,
        printControlProperties,
        &m_d2dPrintControl
        );
    
    
    

    What do I use as the document ?

    I currently have it as null pointer which causes an exception.


    n.Wright

    Saturday, August 24, 2013 11:12 PM

Answers