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

Tilman Hausherr commented on PDFBOX-4710:
-----------------------------------------

Yeah there is more weirdness like that... I noticed this some time ago too but 
never fixed it. My notes from then:

{quote}

setStrokingColor(int) is deprecated, but setNonStrokingColor(int) isn't

2.0:
public void setStrokingColor(int r, int g, int b) throws IOException
public void setStrokingColor(float c, float m, float y, float k) throws 
IOException
public void setStrokingColor(float g) throws IOException

public void setNonStrokingColor(int r, int g, int b) throws IOException
public void setNonStrokingColor(int c, int m, int y, int k) throws IOException
public void setNonStrokingColor(int g) throws IOException
public void setNonStrokingColor(float c, float m, float y, float k) throws 
IOException
public void setNonStrokingColor(float g) throws IOException

trunk:
public void setStrokingColor(int r, int g, int b) throws IOException
public void setStrokingColor(float c, float m, float y, float k) throws 
IOException
public void setStrokingColor(float g) throws IOException

public void setNonStrokingColor(int r, int g, int b) throws IOException
public void setNonStrokingColor(int c, int m, int y, int k) throws IOException
public void setNonStrokingColor(int g) throws IOException
public void setNonStrokingColor(float c, float m, float y, float k) throws 
IOException
public void setNonStrokingColor(float g) throws IOException

{quote}

I also fixed it for non stroking color.

Please test it immediately, a new release is planned for sunday / monday.

https://repository.apache.org/content/groups/snapshots/org/apache/pdfbox/pdfbox-app/2.0.18-SNAPSHOT/

> allow precise RGB stroke colors with setStrokingColor
> -----------------------------------------------------
>
>                 Key: PDFBOX-4710
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-4710
>             Project: PDFBox
>          Issue Type: Improvement
>          Components: PDModel
>    Affects Versions: 2.0.15
>            Reporter: Jason Pyeron
>            Priority: Major
>         Attachments: pdfbox-4710.patch
>
>
> see patch
>  
> PDF in the wild has {{0.262745 0.301961 0.631373 RG}} but this cannot be 
> represented as a n/255 fraction.
>  
> {code:java}
> package snippet;
> public class Snippet
> {
>     public static void main(String[] args)
>     {
>         System.out.println(((int)67)/255f);
>         System.out.println(0.2627451f*255f);
>         System.out.println(0.262745f*255f);
>         System.out.println(66.99997f/255f);
>     }
> }
> {code}



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

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

Reply via email to