[jira] [Commented] (PDFBOX-1176) Watermark Annotations

2020-10-31 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on PDFBOX-1176:
-

Commit 1883015 from Tilman Hausherr in branch 'pdfbox/branches/2.0'
[ https://svn.apache.org/r1883015 ]

PDFBOX-1176: add rotated page

> Watermark Annotations
> -
>
> Key: PDFBOX-1176
> URL: https://issues.apache.org/jira/browse/PDFBOX-1176
> Project: PDFBox
>  Issue Type: Wish
>  Components: Writing
>Affects Versions: 1.8.7, 2.0.0
>Reporter: Rubesh MX
>Priority: Major
>  Labels: Watermark
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I am checking if watermarks can  be added to a PDF doc and the same way can 
> be removed, so far I could not find any option to do that with PDFBox; It 
> will be better if we have an option to add and remove watermak to a PDF.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-1176) Watermark Annotations

2020-10-31 Thread ASF subversion and git services (Jira)


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

ASF subversion and git services commented on PDFBOX-1176:
-

Commit 1883014 from Tilman Hausherr in branch 'pdfbox/trunk'
[ https://svn.apache.org/r1883014 ]

PDFBOX-1176: add rotated page

> Watermark Annotations
> -
>
> Key: PDFBOX-1176
> URL: https://issues.apache.org/jira/browse/PDFBOX-1176
> Project: PDFBox
>  Issue Type: Wish
>  Components: Writing
>Affects Versions: 1.8.7, 2.0.0
>Reporter: Rubesh MX
>Priority: Major
>  Labels: Watermark
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> I am checking if watermarks can  be added to a PDF doc and the same way can 
> be removed, so far I could not find any option to do that with PDFBox; It 
> will be better if we have an option to add and remove watermak to a PDF.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

-
To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org
For additional commands, e-mail: dev-h...@pdfbox.apache.org



[jira] [Commented] (PDFBOX-1176) Watermark Annotations

2014-12-17 Thread JIRA

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14249730#comment-14249730
 ] 

Andreas Lehmkühler commented on PDFBOX-1176:


Postponed to 2.1.0 as long noone comes up with a patch

 Watermark Annotations
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
  Components: Writing
Affects Versions: 1.8.7, 2.0.0
Reporter: Rubesh MX
  Labels: Watermark
 Fix For: 2.1.0

   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-22 Thread JIRA

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13610324#comment-13610324
 ] 

Andreas Lehmkühler commented on PDFBOX-1176:


I guess there was a missunderstanding, Maruan wasn't pointing to Overlay but to 
OverlayPDF. The latter should support pages using a COSArray to store the 
content.

But I guess the whole discussion went to a wrong direction. If we talk about 
watermarks we should talk about watermark annotations.

 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-22 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13610352#comment-13610352
 ] 

Maruan Sahyoun commented on PDFBOX-1176:


IMHO there are two terms called watermarks which exist in the wild. 

# watermarks in the sense of watermark annotations
# watermarks in the sense of drawing over/under a current page content. 

I think the latter is wrongly cause by libraries working with terms such as 
overContent and underContent which is only a helper to draw above/under the 
rest of the page but might lead to the impression that such content definition 
is available in PDF. There are sample using the term watermark but using the 
latter approach. On the other hand we are not clear what the ticket is about. 
Maybe we should rephrase it to 'support watermark annotations'.

In addition we might think about introducing helpers such as over/under or 
foreground/background as watermark annotations are a PDF 1.6 feature to support 
earlier implementations.



 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-20 Thread MH (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13607598#comment-13607598
 ] 

MH commented on PDFBOX-1176:


Well, it would be at least a big step forward if adding a watermark text would 
work. I tried with PDPageContentStream.drawString() to get at least some kind 
of workaround. (The examples I have found to add an Image via 
PDFContent.addImage() is no option for us.) But the first problem is, that this 
text overlaps the content and the text is always in black - even though I set 
cs.setStrokeingColor(Color.RED). My code:

---
final PDPageContentStream cs = new PDPageContentStream(doc, page, true, false, 
true); //4th parameter = resetContext
try {

//simple text above the page:
cs.beginText();
cs.setStrokingColor(fontColor); //doesn't work
cs.setFont(font, fontSize);
cs.moveTo(10, 10);
//cs.moveTextPositionByAmount(10, 10);
//cs.setTextTranslation((pageSize.getWidth() / 2.0) - (stringWidth / 2.0), 
(pageSize.getHeight() / 2.0) - (fontSize / 2.0));
cs.setTextRotation((double) 0.2, (pageSize.getWidth() / 2.0) - (stringWidth 
/ 2.0), (pageSize.getHeight() / 2.0) - (fontSize / 2.0));
//cs.setTextScaling(10.0, 10.0, (pageSize.getWidth() / 2.0) - (stringWidth 
/ 2.0), (pageSize.getHeight() / 2.0) - (fontSize / 2.0));
cs.setStrokingColor(Color.BLUE); //doesn't work
cs.drawString(text);
cs.endText();
} finally {
if (cs != null) {
cs.close();
}
}
-

 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-20 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13607654#comment-13607654
 ] 

Maruan Sahyoun commented on PDFBOX-1176:


Try this

PDDocument document = PDDocument.load(  );
PDPage page = (PDPage) 
document.getDocumentCatalog().getAllPages().get(0);

// The transparency, opacity of graphic objects can be set directly 
on the drawing commands
// but need to be set to a graphic state which will become part of 
the 
// resources.
 
/* Set up the graphic state */

// Define a new extended graphic state
PDExtendedGraphicsState extendedGraphicsState = new 
PDExtendedGraphicsState();
// Set the transparency/opacity
extendedGraphicsState.setNonStrokingAlphaConstant(0.5f);
// Get the page resources.
PDResources resources = page.findResources();

// Get the defined graphic states.
Map graphicsStateDictionary = resources.getGraphicsStates();

graphicsStateDictionary.put(TransparentState, 
extendedGraphicsState);
resources.setGraphicsStates(graphicsStateDictionary);

/* End of setup */

PDFont font = PDType1Font.HELVETICA;

// Now we will be able to call the state definition before doing 
the drawing
PDPageContentStream contentStream = new 
PDPageContentStream(document, page,true,true);  
contentStream.appendRawCommands(/TransparentState gs\n);
contentStream.setNonStrokingColor(Color.yellow);
contentStream.beginText();
contentStream.setFont( PDType1Font.HELVETICA, 72 );
contentStream.moveTextPositionByAmount( 10, 10 );
contentStream.setTextRotation(1,100,100);
contentStream.drawString( Watermark );
contentStream.endText();
contentStream.close();

document.save(watermark.pdf);

 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-20 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13607720#comment-13607720
 ] 

Maruan Sahyoun commented on PDFBOX-1176:


Well, I omitted the checks for simplicity. This is not production strength but 
should illustrate a potential approach!

if (graphicsStateDictionary == null){
graphicsStateDictionary = new TreeMap();
}

There are more checks needed e.g.. page.findResources() could be null 

And, if it's the same watermark on every page, doing an overlay/underlay would 
be better as the 'object' is then defined only once and reused. Look at the 
OverlayPDF command line tool to see how this can be done.



 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-20 Thread MH (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13607722#comment-13607722
 ] 

MH commented on PDFBOX-1176:


Overlay doesn't work for my PDFs: UnsupportedOperationException: Layout pages 
with COSArray currently not supported.

So, the only problem left is the font color.

 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-20 Thread Maruan Sahyoun (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13607728#comment-13607728
 ] 

Maruan Sahyoun commented on PDFBOX-1176:


as you might have seen in the sample code you need to use 
contentStream.setNonStrokingColor(Color.yellow);

 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (PDFBOX-1176) Watermark

2013-03-20 Thread MH (JIRA)

[ 
https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13607765#comment-13607765
 ] 

MH commented on PDFBOX-1176:


setNonStrokingColor() ... how intuitive! 

So, the visual output is like a watermark - but it's a transparent text on each 
page. Better than nothing. I wonder if the same can be by drawing the text to 
an underlay?

 Watermark
 -

 Key: PDFBOX-1176
 URL: https://issues.apache.org/jira/browse/PDFBOX-1176
 Project: PDFBox
  Issue Type: Wish
Reporter: Rubesh MX
  Labels: Watermark
   Original Estimate: 24h
  Remaining Estimate: 24h

 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


Re: [jira] [Commented] (PDFBOX-1176) Watermark

2013-03-20 Thread Maruan Sahyoun
can we move the discussion to the us...@pdfbox.apache.org mailing list?

Maruan Sahyoun

Am 20.03.2013 um 17:01 schrieb MH (JIRA) j...@apache.org:

 
   [ 
 https://issues.apache.org/jira/browse/PDFBOX-1176?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13607765#comment-13607765
  ] 
 
 MH commented on PDFBOX-1176:
 
 
 setNonStrokingColor() ... how intuitive! 
 
 So, the visual output is like a watermark - but it's a transparent text on 
 each page. Better than nothing. I wonder if the same can be by drawing the 
 text to an underlay?
 
 Watermark
 -
 
   Key: PDFBOX-1176
   URL: https://issues.apache.org/jira/browse/PDFBOX-1176
   Project: PDFBox
Issue Type: Wish
  Reporter: Rubesh MX
Labels: Watermark
 Original Estimate: 24h
 Remaining Estimate: 24h
 
 I am checking if watermarks can  be added to a PDF doc and the same way can 
 be removed, so far I could not find any option to do that with PDFBox; It 
 will be better if we have an option to add and remove watermak to a PDF.
 
 --
 This message is automatically generated by JIRA.
 If you think it was sent incorrectly, please contact your JIRA administrators
 For more information on JIRA, see: http://www.atlassian.com/software/jira