Leonard Rosenthol-3 wrote
> 
> Use CurveTo instead :).
> 

Ok, Thanks to Leonard and Paulo for all the advice its all done and looking
good :)

I thought I'd make a Template for the appearance as originally advised by
Paulo and see if I could keep the annotation instead of writing directly on
the page. I almost succeeded but have found that the appearance is
displaying misaligned and clips beyond the rectangle/template borders. Am I
doing something wrong? Is this something that can be easily fixed? (If not,
I'll quit while I'm ahead :) )

  Rectangle rect = new Rectangle(103.07f, 27.47f, 223.08f, 89.08f);
  PdfAnnotation annotation =
PdfAnnotation.createInk(pdf_stamper.getWriter(), rect, "", gestures);
  PdfContentByte cb = pdf_stamper.getOverContent(5); // is this ok?
  PdfTemplate apTemplate = cb.createTemplate(rect.getWidth(),
rect.getHeight()); // should I be setting the template dimensions to those
of the annotation rectangle I'm recreating below?

  // ...apTemplate.moveTo(), apTemplate.lineTo(), apTemplate.stroke() //
create annotation appearance

  annotation.setAppearance(annotation.APPEARANCE_NORMAL, apTemplate);
  pdf_stamper.addAnnotation(annotation,5);


I read somewhere this might be something to do with the cropBox and media
box being different? I checked this but they are both the same:
System.out.println(reader.getCropBox(5)); // Rectangle: 612.0x792.0 (rot: 0
degrees)
System.out.println(reader.getPageSize(5)); // Rectangle: 612.0x792.0 (rot: 0
degrees)

Any ideas?

--
View this message in context: 
http://itext-general.2136553.n4.nabble.com/createInk-not-displaying-in-PDF-on-Ubuntu-Linux-tp4292565p4303884.html
Sent from the iText - General mailing list archive at Nabble.com.

------------------------------------------------------------------------------
Keep Your Developer Skills Current with LearnDevNow!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-d2d
_______________________________________________
iText-questions mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/itext-questions

iText(R) is a registered trademark of 1T3XT BVBA.
Many questions posted to this list can (and will) be answered with a reference 
to the iText book: http://www.itextpdf.com/book/
Please check the keywords list before you ask for examples: 
http://itextpdf.com/themes/keywords.php

Reply via email to