Posts by Lena Vladykina

    From what I see, watermarks could not be saved over PDFs, could they?



    I would also much appreciate, if you can give some examples/clarification to what extend metafile stamping is supported. I tried with 'Hello,World!' texted transporant wmf file with the same results --'nothing is seen'....

    Dear Support,


    I am seeking a way to add vector graphics and to save it over a PDF with the help of your WPViewPDF.


    I have tried your examle code from here https://www.wpcubed.com/manual…er_metafiles_to_pages.htm with both Scaling parameters (0 - like in the example, 72 - like in the recommendations) , but with no success so far -- no stemped MetaFile is seen...


    Could you please have a look and say what's wrong? Should I send you PDFs?


    procedure TForm1.Button2Click(Sender: TObject);

    var

    Metafile1 : TMetafile;

    begin

    Metafile1 := TMetafile.Create;

    try

    Metafile1 := WPViewPDF1.GetMetafile(0);

    // Metafile1.SaveToFile('c:\temp\pdftowmf.wmf'); // gives a nice wmf

    // WPViewPDF2.Command( COMPDF_StampMetafile_Scaling, 0 );

    WPViewPDF2.Command( COMPDF_StampMetafile_Scaling, 72 );


    if Metafile1<>nil then

    begin

    WPViewPDF2.CommandStrEx (COMPDF_StampMetafile, '1', MetaFile1.Handle);

    WPViewPDF2.Plus.SaveToFile('c:\temp\test_modified.pdf');

    end;

    finally

    Metafile1.Free;

    end;

    end;


    FYI: WPDFVIEW License owner : Aiiti Gmbh



    Many thanks for advance.


    Sinserely,

    Olena Vladykina

    Dear Support,


    I would want to add a text with transporan backgraund to a PDF file, to be able to place this text wih respect to the page rotation and to save it to a PDF file.

    I have found this pritty example here in the forum, Could you please, also, help me and say if this can this be modified so that the text can be rotated in line with the page rotation ?

    Many thank for advance!


    Lena


    1. function dicituraFissa(szNomeFile:pchar):boolean;
    2. var StampMetaCan : TMetafileCanvas;
    3. aForm : TXForm;
    4. x,y,nrP: integer;
    5. lst :TStringlist;
    6. n,idx:integer;
    7. sz:String;
    8. wp :TWPViewPDF;
    9. StampMeta : TMetaFile;
    10. begin
    11. wp:=TWPViewPDF.CreateParented(application.handle);
    12. wp.LoadFromFile(strpas(szNomeFile)) ;
    13. if true then
    14. begin
    15. StampMeta:=TmetaFile.create;
    16. StampMetaCan := TMetafileCanvas.Create(StampMeta,0);
    17. try
    18. StampMetaCan.Font.Height := -10;
    19. StampMetaCan.Font.Color := clBlack;
    20. StampMetaCan.Font.Name := 'Arial';
    21. StampMetaCan.Brush.Style := bsClear;
    22. aForm.eM11 := 1;
    23. aForm.eM12 := 0;
    24. aForm.eM21 := 0;
    25. aForm.eM22 := 1;
    26. aForm.eDx := Screen.PixelsPerInch;
    27. aForm.eDy := Screen.PixelsPerInch*2;
    28. SetWorldTransform(StampMetaCan.Handle, aForm);
    29. nrP:=wp.CommandEx(COMPDF_GetPageCount,0);
    30. y:=WPCentimeterToPixel(28,72);
    31. x:=WPCentimeterToPixel(1,72);
    32. lst:=TStringlist.create;
    33. lst.text:=strpas('Try write text on pdf');
    34. idx:=0;
    35. for n := lst.count - 1 downto 0 do
    36. begin
    37. StampMetaCan.TextOut(x,y-(15*(n+1)), lst[idx]);
    38. inc(idx);
    39. end;
    40. lst.free;
    41. finally
    42. StampMetaCan.Free;
    43. end;
    44. wp.CommandStrEx(495,inttostr(nrP)+'-'+inttostr(nrP), StampMeta.Handle)
    45. wp.Plus.SetSecurityMode(wpNoSecurity);
    46. wp.Plus.SaveToFile('C:\tmp\test.pdf');
    47. StampMeta.free;
    48. end;
    49. wp.free;
    50. end;



    DLL Version 401940.