Yes, there’s not a built-in API for this, so you have to write the
PDF commands out yourself. PDF uses an external graphics state
object which you can enable with the “gs” operator:

Assuming you have a PDPageContentStream named “contents”:

PDExtendedGraphicsState gs1 = new PDExtendedGraphicsState();
gs1.setNonStrokingAlphaConstant(.33f);
page.getResources().put(COSName.getPDFName("gs1"), gs1);

… do what you like here

contents.saveGraphicsState()
contents.appendRawCommands("/gs1 gs\n”);
… draw your from
contents.restoreGraphicsState()

-- John

> On 8 Jan 2015, at 10:52, Gilles Coppex <[email protected]> wrote:
> 
> Dear all,
> 
> Can we reduce the alpha channel before calling the drawXObject() method?
> I would like to embedd the other pdf with a 33% transparency.
> 
> 
> P.S.: I reposted this question as a new thread because it seems more
> logical to separate topics.
> 
> Thanks a lot
> 
> G. Coppex

Reply via email to