How use custom media size in print surpport app?

xianke lee 0 Reputation points
2025-06-05T08:56:55.45+00:00

in print surpport app, change paper size from A4 to custom media size, call SetParameterInitializerAsInteger method set PageMediaSizeMediaSizeWidth, app will dump. how to use it correctly?

Developer technologies | C#
Developer technologies | C#

An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.


1 answer

Sort by: Newest
  1. Anonymous
    2025-08-13T06:29:56.7366667+00:00

    Thank you for reaching out!

    Please follow the steps to solve the issue :

    1.Ensure the method is called on the correct thread—UI thread issues can cause instability.
    2. Use Print Schema Specification v2.0 to define custom media sizes properly. This involves inserting a psk:CustomMediaSizenode under PageMediaSize with appropriate margins and references to MediaSizeHeight and MediaSizeWidth
    3. Validate the PrintTicketFeature and ensure the custom size is supported by the printer driver. Some IPP class drivers may not support user-defined sizes.

     

    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.