pdfView GetMEtaFile

  • HEllo

    I updated some month ago
    I just noticed that the GetMetaFile dind't work anymore sometimes the distance between two words is incorrect

    i tried to modify the ViewDemo1 from you just extract the metafile and show it

    Code
    Image1.Picture.Graphic      := WPViewPDF1.GetMetafile(1);
        Image1.BringToFront;
        WPViewPDF1.Visible      := FALSE;

    This is the screenshot form the pdfviewer (PDFView1)
    [Blockierte Grafik: http://support.ulysses-erp.com/pdf_viewer.png]

    and if i start the above three lines of code i get following

    [Blockierte Grafik: http://support.ulysses-erp.com/pdf_viewer_metafile.png]

    you can see it in the last line, between "Bedienungsanleitung in" there is no Space in the metafile!

    what can i do?

    The last pdfview.dll extracted the metafile correct!

    • Offizieller Beitrag

    Hi,

    WPViewPDF V3 and V4 is internally GDI+ based, this can cause some different rendering. I don't know from which version you upgraded.
    In general for GUI display I would not use a metafile, better PNG.

    If the file is displayed wrong in the viewer please send me a PDF file to reproduce.

    If you need PDF to Metafile for rendering I rather recommend to use the "pdf to watermark" feature which had been added to WPViewPDF V4 - you get the best output quality only with this since all PDF features are copied to the destination.

    • Offizieller Beitrag

    The new feature of WPViewPDF 4 which I noted above is the watermark overlay.
    Please check it out - however I cannot know what the purpose of that picture in your application is.

    To assign a page to a TPicture this code is the best possible:

    WPViewPDF1.command(COMPDF_AdvancedFontDrawing,4); //GDI Fonts
    Image1.Picture.Assign(WPViewPDF1.GetMetafilePrn(0));

    Using PrintHDC on a bitmap.canvas.handle does surprisingly not work - not because of an error in the PrintHDC method but because the Canvas.Handle becomes invalid during the call. I don't know what the reason for this is - it happens even if though the dc is not touched or changed.