[ 
https://issues.apache.org/jira/browse/PDFBOX-4556?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16867789#comment-16867789
 ] 

Tilman Hausherr commented on PDFBOX-4556:
-----------------------------------------

1) "I have also wrote the appearance stream hard way as you mentioned but not 
got any visual representation for that" ==> *please share the result file*

2) re the exception: only the two lines at the beginning and the two last lines 
are relevant, the code between (with {{PDDeviceRGB}}) is a misunderstanding by 
you - you used the code I showed that was meant to tell you where the 
{{IllegalArgumentException}} came from. This is not needed in your code!

What kind of exception do you get when calling {{new PDJpeg(doc, bufferedImage, 
compression)}} ? You didn't mention. At what line?

Besides, the best way to work with jpegs is to use the stream directly (only if 
it is a JPEG stream!!!), as I did in the sample code {{new PDJpeg(doc, new 
FileInputStream(tickImagePath))}}.

It may be possible that whatever you are using doesn't have a good jpeg 
handling library. Try [https://github.com/haraldk/TwelveMonkeys] .

For jpeg you'll need these files:

{{twelvemonkeys-common-lang-3.4.1.jar}}
{{ twelvemonkeys-common-io-3.4.1.jar}}
{{ twelvemonkeys-common-image-3.4.1.jar}}
{{ twelvemonkeys-imageio-core-3.4.1.jar}}
{{ twelvemonkeys-imageio-metadata-3.4.1.jar}}
{{ twelvemonkeys-imageio-jpeg-3.4.1.jar}}

If it isn't a JPEG, then read the file into a {{BufferedImage}} and use 
{{PDPixelMap(PDDocument doc, BufferedImage bi)}}.

It might still not work. As I've told you before, PDFBox is for java. If you 
really want to use C#, you should license itext, and would probably be done 
within a day or two.

> how the visual representation of the signature is achieved  
> ------------------------------------------------------------
>
>                 Key: PDFBOX-4556
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4556
>             Project: PDFBox
>          Issue Type: Wish
>          Components: .NET
>    Affects Versions: 1.8.16
>            Reporter: bal
>            Priority: Major
>         Attachments: image  error stacktrace.txt, npe at adappearence 
> dictionary.txt, pdfAnnotation.pdf, visibleSignature.pdf
>
>




--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to