0

the adobe acrobat reader have markup tool called "text callout".

It's possible to build with PDF Clown a object of this type?

Enamul Hassan
  • 5,266
  • 23
  • 39
  • 56
godani
  • 1
  • 2
  • Please link to a sample PDF with such a text callout. And what have you tried? – mkl Aug 05 '16 at 13:16
  • You can get sample file here: http://www.file-upload.net/download-11825556/testfilewithtextcallout.pdf.html I want create a text callout with PDF Clown library. It's possible? – godani Aug 05 '16 at 16:17
  • It is not clear where i can download there. I only see ads. – mkl Aug 05 '16 at 19:55
  • Welcome to Stack Overflow! I edited your question as far as I could guess your problem. However, add code and description so that more people with knowledge of the subject will see it. Please edit in the specific error-message you're encountering in case that's necessary to identify the specific problem. Good Luck! – Enamul Hassan Aug 07 '16 at 14:03

1 Answers1

0

The sample provided by the OP looks pretty much like the PDF Clown StaticNote with a StaticNote.CalloutLine.

The relevant code from the AnnotationSample PDF Clown cli example are:

// Callout.
composer.showText("Callout note annotation:", new Point(35, 85));
new StaticNote(
  page,
  new Rectangle(250, 90, 150, 70),
  "Text of the Callout note annotation"
  ).withLine(
     new StaticNote.CalloutLine(
       page,
       new Point(250,125),
       new Point(150,125),
       new Point(100,100)
       )
     )
   .withLineEndStyle(LineEndStyleEnum.OpenArrow)
   .withBorder(new Border(1))
   .withColor(DeviceRGBColor.get(Color.YELLOW));

(From AnnotationSample.java)

The output:

screenshot of <code>AnnotationSample</code> result

mkl
  • 90,588
  • 15
  • 125
  • 265
  • Thank you for your detailed reply, I will try with StaticNote. – godani Aug 10 '16 at 10:19
  • @godani And, did you succeed? – mkl Aug 16 '16 at 10:05
  • Sry, but it doesn't work. I can't import library "org.pdfclown.documents.interaction.annotations.StaticNote". I get error message: "The import org.pdfclown.documents.interaction.annotations.LineEndStyleEnum cannot be resolved". How do the import works right? – godani Aug 16 '16 at 16:36
  • In that case you have a much more basic problem. Either you don't have pdf clown on your build path at all or only a very old version of it. – mkl Aug 16 '16 at 19:20
  • I had downloaded and imported PDF Clown 0.1.2.0 from "https://pdfclown.org/downloads/". Is this not the current Version? – godani Aug 17 '16 at 08:57
  • The original 0.1.2.0 indeed is too old, it is dated 10.02.2013. The next release after 0.1.2 should have been 0.2.0, but as that release got more and more delayed, the PDF Clown author provided some changes and additions in the [0.1.2-Fix branch](https://svn.code.sf.net/p/clown/code/branches/0.1.2-Fix) and [trunk](https://svn.code.sf.net/p/clown/code/trunk) in 2015. Either version contains `StaticNote`. Either checkout one of those branches from the svn repository or for trunk use the ZIP under "PDF Clown HEAD", "Latest Development Snapshot" on the downloads page. – mkl Aug 17 '16 at 13:04
  • Now it works well, thanky you very much! It is possible to get coordinates where text end on left and right side on page? – godani Aug 22 '16 at 09:12
  • @godani Do you mean the text in the annotation? Or do you mean content text on a page? In the former case I don't know. In the latter case please make it a separate Question here as it is a topic on its own right. – mkl Aug 22 '16 at 12:02
  • Concerning this question: As you say it now works well, you probably should accept the answer (click on the tick at its upper left). – mkl Aug 22 '16 at 12:03
  • I mean the Content text on a page. I have post this question under this link: http://stackoverflow.com/questions/39102237/get-coordinates-of-content-area-at-pdf – godani Aug 23 '16 at 13:14
  • Yes, i will do it. Thanks for your support! – godani Aug 23 '16 at 13:16
  • Ah, I just see your new question has been put on hold. I think it is because it is expected on stackoverflow that you try to find out yourself and, if you get stuck on the way, present your pivotal code and explain the issue ("This is where I got stuck, I expected XXX to happen but I observe YYY."). – mkl Aug 24 '16 at 06:30
  • @godani Unfortunately you had not also tagged that other question with [tag:pdf]; it would have made re-opening it easier. – mkl Aug 24 '16 at 06:38