Creating PDF from EMF (Metafile) In Landscape

  • Hi ,

    I am creating EMF file from GDI+ in C# when create a file in Portrait orientation its working fine but for landscape its not working as expected following are some scenarios I tried

    1) create the METAFILE in Portrait and set landscape = true , resulted in a rotated file

    1) create the METAFILE in Landscape and set landscape = true , resulted in a rotated file and some portion of the file was cliped

    I have some examples on past threads to rotate the EMF Manually , I was not able to undersatand the example as I am working .Net wrapper of WPDF4


    Please help me in this regard

  • Hi ,

    I tried to implement the stretchdraw as recommended however I was not able to find this method in the .net Wrapper following is the code snippet I am working on .

    • Offizieller Beitrag

    Ok, this is about wPDFControl, not the VCL wPDF.

    It is not clear for me what your landscape-metafile looks like. Is it rotated by 90 degrees?

    If not, as I assume, do not set the landscape flag in wPDFControl.

    If you use StartPage ... EndPage you can create a page with the desired dimensions (resolution in 72 dpi) and then use the Canvas methods to draw your metafile.

    You can apply Graphics methods to rotate any subsequent output and then draw your metafile on this Canvas. You can also print on this "Canvas".

    Do not use DrawMetafile since it will output your metafile data without any change.