Stamper and Color Modes

53 views
Skip to first unread message

Brian Hogue

unread,
Mar 19, 2014, 3:26:03 PM3/19/14
to pdfne...@googlegroups.com
We are using the Stamper class as follows:

Font font = Font.createTrueTypeFont(thisDoc,this.getClass().getResourceAsStream(fontLocation), true, true);
Stamper s = new Stamper(Stamper.e_font_size, fontSize, 0);
s.setFont(font);
s.setFontColor(new ColorPt(0, 0, 0, 1));

We are trying to produce PDF/X-1a compliant output but the resulting font seems to end with an RGB color mode. We were hoping "s.setFontColor(new ColorPt(0, 0, 0, 1));" would cause the CMYK color mode to be used. Are we improperly setting the font color or is the Stamper the wrong tool for the job.

Thanks.

Aaron Gravesdale

unread,
Mar 19, 2014, 7:33:36 PM3/19/14
to pdfne...@googlegroups.com
Hello Brian,

Stamper will only stamp text in RGB.  One option may be for you to create CMYK text in a new PDF page and then use Stamper.StampPage() instead of StampText():

http://www.pdftron.com/pdfnet/PDFNet/html/M_pdftron_PDF_Stamper_StampPage.htm

Please let me know whether this helps and if you have any further questions.

Brian Hogue

unread,
Mar 20, 2014, 6:44:16 PM3/20/14
to pdfne...@googlegroups.com
Thank you. Would using ElementEdit make more sense for altering existing pages?

Support

unread,
Mar 20, 2014, 6:58:46 PM3/20/14
to pdfne...@googlegroups.com

Depends on what are your requirements. ElementEdit is a relatively low-level option
A bit more high-level option is ContentReplacer ... as shown in ContentReplacer sample:
Reply all
Reply to author
Forward
0 new messages