pdfbox-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gilad Denneboom <gilad.denneb...@gmail.com>
Subject Re: Move rotated text to center of page
Date Wed, 25 Jan 2017 16:26:19 GMT
Old habits die hard, you know... But thanks, I switched this project over
to v2 and it's working fine.

On Wed, Jan 25, 2017 at 4:57 PM, Tilman Hausherr <THausherr@t-online.de>
wrote:

> Am 24.01.2017 um 23:42 schrieb Gilad Denneboom:
>
>> Is this a new feature? I was using version 1.8.13 and couldn't find it. I
>> guess I'll need to switch to version 2.x.x ...
>>
>
>
> Yes it is new. It was available in low level in 1.8.* but the code is much
> larger:
>
>     PDExtendedGraphicsState gs0 = new PDExtendedGraphicsState();
>     gs0.setNonStrokingAlphaConstant(value);
>     Map<String, PDExtendedGraphicsState> graphicsStatesMap =
> page.getResources().getGraphicsStates();
>     if (graphicsStatesMap == null)
>     {
>        graphicsStatesMap = new HashMap<String, PDExtendedGraphicsState>();
>     }
>     graphicsStatesMap.put("gs0", g0);
>     page.getResources().setGraphicsStates(graphicsStatesMap);
>     contentStream.appendRawCommands("/gs0 gs\n");
>
> Better update to 2.0.* so that all the work we put into this has a purpose.
>
>
> Tilman
>
>
>
>> On Tue, Jan 24, 2017 at 11:35 PM, Tilman Hausherr <THausherr@t-online.de>
>> wrote:
>>
>> Am 24.01.2017 um 23:26 schrieb Gilad Denneboom:
>>>
>>> Thanks again, but I'm not seeing any examples on how to use
>>>> setGraphicsStateParameters (or is it SetGraphicsStateParameters?) in
>>>> this
>>>> context... Could you help me out?
>>>>
>>>> You just call PDPageContentStream.setGraphicsStateParameters() with the
>>> variable.
>>>
>>> https://stackoverflow.com/questions/38433534/pdfbox-inconsis
>>> tent-co-ordinate-system-how-do-i-draw-a-rectangle
>>> https://stackoverflow.com/questions/39609617/how-to-add-text
>>> -watermark-to-pdf-in-java-using-apache-pdfbox
>>> https://stackoverflow.com/questions/40267719/pdfbox-2-1-0-
>>> when-printed-from-ie11-transparent-text-watermark-has-opaque-ba
>>>
>>> Tilman
>>>
>>>
>>>
>>> On Tue, Jan 24, 2017 at 11:05 PM, Tilman Hausherr <THausherr@t-online.de
>>>> >
>>>> wrote:
>>>>
>>>> Am 24.01.2017 um 22:58 schrieb Gilad Denneboom:
>>>>
>>>>> One other thing: Is it possible to set the text's opacity level?
>>>>>
>>>>>>
>>>>>>               PDExtendedGraphicsState gs0 = new
>>>>> PDExtendedGraphicsState();
>>>>>               gs0.setNonStrokingAlphaConstant(value);
>>>>>
>>>>> then assign this extended graphics state (outside of the text mode)
>>>>> with
>>>>> setGraphicsStateParameters().
>>>>>
>>>>> Tilman
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>>>
>>>>>
>>>>>
>>>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
>>> For additional commands, e-mail: users-help@pdfbox.apache.org
>>>
>>>
>>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@pdfbox.apache.org
> For additional commands, e-mail: users-help@pdfbox.apache.org
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message