Adding hidden layer/text to a PDF document

  • Trying to figure out how to add a hidden layer or hidden text to a PDF document. Wanting to embed some text in a PDF but not have it visible when viewing the PDF or included when printing the PDF. However, if a PDF tool is used it could be seen/retrieved. Can this be accomplished with the WPViewPDF tool? I'm having trouble making it work. I can stamp text on top of a document but cannot figure out how to hide it or put it behind the PDF contents. Will this component allow me to do this? Thank you in advance for your help.

  • How do I set the background color? Just to test I was trying to set the background to black with white text but the background always seems to be white. What am I doing wrong?

    WPViewPDF.LoadFromFile(ExtractFilePath(Application.Exename) + 'mytest.pdf');

    FillChar(t, SizeOf(t), 0);

    t.PageNo := 0; // First Page
    t.grtyp := 100; // Shape type = Text
    t.typparam := 2000; // Textfield, Height = 20
    t.Angle := 180; // the angle, used for text only
    t.Alpha := 100; // make transparent
    t.ColorText := ColorToRGB( clWhite );
    t.ColorPen := ColorToRGB( clBlack );
    t.ColorBrush := ColorToRGB( clBlack );

    t.x := 525;
    t.y := 34;
    t.h := 10;
    t.w := 13 * 3;

    WPViewPDF.AddDrawObject(wpAddNow, 'TestField', t, '123456789', '');
    WPViewPDF.CommandEx(COMPDF_RenderDrawobjects, 4 + 8 + 32);