Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

how to write text with transparency level

Help
2012-08-25
2013-05-28
  • How I can write colored text which contain a certain level of transparency. I saw in other pdf lib it was possible. How it works with this lib.

     
  • I already discovered the solution:

    PDExtGState extGState = (PDExtGState) PDExtGState.META.createNew();
        extGState.setStrokingAlphaConstant(0.6f);
        extGState.setNonStrokingAlphaConstant(0.2f);
      
    // open a device to the page content stream
    CSCreator creator = CSCreator.createNew(page);
    creator.setExtendedState(null, extGState);

     
  • mtraut
    mtraut
    2012-08-30

    … back from holidays - thank you for sharing your solution.