[email protected] wrote:
> Leonard is right (sorry for not having been specific enough), it is about
> optional content.
> Actually it was not the PDF reference leading me to this observation, but
> I have noticed this options (always,never,when visible) working with one
> of my envelope PDFs created from scratch and opened in Acrobat Pro 7. The
> reader can not alter this options, but the Professional edition can. I
> guess it should be a change from boolean to integer in the parameter type.
> Infact it is not directly the PdfContentByte (that was not exact in my
> previous message), but the PdfLayer.setPrint() method which takes as a
> second parameter boolean (hence limited to two different values) for
> describing whether the optional content is intended  for use in printing.

I referred to the PDF Reference because on p381 (PDF 1.7) it says (I quote):

Print:
   (Optional) A dictionary specifying that the content in this group is
   intended for use in printing. It contains the following optional
   entries:
* Subtype:
   A name object specifying the kind of content controlled by the group;
   for example, Trapping, PrintersMarks and Watermark.
* PrintState:
   A name that may be ON or OFF, indicating that the group should be set
   to that state when the document is printed from a viewer application.

in iText, this is implemented as follows:

public void setPrint(String subtype, boolean printstate) {
   PdfDictionary usage = getUsage();
   PdfDictionary dic = new PdfDictionary();
   dic.put(PdfName.SUBTYPE, new PdfName(subtype));
   dic.put(PdfName.PRINTSTATE, printstate ? PdfName.ON : PdfName.OFF);
   usage.put(PdfName.PRINT, dic);
}

We can add an additional method if you want to, but we can't "invent" 
things that aren't in the PDF Reference. You'll have to be more clear
if you want us to change something.
-- 
This answer is provided by 1T3XT BVBA
http://www.1t3xt.com/ - http://www.1t3xt.info

------------------------------------------------------------------------------
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

Buy the iText book: http://www.1t3xt.com/docs/book.php

Reply via email to