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

Daniel Wilson commented on PDFBOX-615:
--------------------------------------

I'll note my "progress" here in hopes that if I'm way off base in the concept, 
one of you can throw a flag.

It does seem that there should be a class to represent a Shading Dictionary.  
Conceptually it is parallel to PDPattern, so I now have a PDShading class.  I 
haven't committed this code as it's really not doing anything yet ... but it 
looks like part of the solution.

The piece I completely overlooked in last night's comment was the _sh_ 
operator.  I'm implementing it as o.a.p.util.operator.pagedrawer.SHFill.

At this point its process method is simply logging the argument list.

This operator is getting a single name argument -- just like the spec says it 
should.  In my case it's:
[COSName{Sh0}]

I must say I'm a little confused regarding how to take that name and get the 
Shading Dictionary.

The relevant section of the PDF file looks like this:
<</Parent 2 0 R
    /Contents 178 0 R
    /BleedBox[0.0 0.0 1152.0 1656.0]
    /PieceInfo
        <</Illustrator 142 0 R>>
    /ArtBox[39.6431 171.689 963.828 1655.02]
    /MediaBox[0.0 0.0 1152.0 1656.0]
    /Thumb 183 0 R
    /TrimBox[0.0 0.0 1152.0 1656.0]
    /Resources
        <</Shading
            <</Sh0 170 0 R>>
            /ColorSpace
                <</CS0 174 0 R/CS1 162 0 R/CS2 175 0 R/CS3 168 0 R/CS4 163 0 
R/CS5 169 0 R>>
            /Font
                <</T1_0 176 0 R>>
            /ProcSet[/PDF/Text]
            /Properties
            <</MC0 158 0 R>>
            /ExtGState
                <</GS0 161 0 R>>
        >>
        /Type
        /Page
        /LastModified(D:20090602144525-05'00')
    >>

The Sh0 name is clearly there ... and it refers to object 170 if I'm reading it 
right.  Object 170 appears to be:
170 0 obj
<</ColorSpace 162 0 R/AntiAlias false/Coords[0.0 0.0 1.0 0.0]/Function 171 0 
R/Extend[true true]/Domain[0.0 1.0]/ShadingType 2>>
endobj

This contains the required entries for a shading dictionary of ShadingType 2 
(Axial) as well as a couple of the optional ones.

Which all brings me back to trying to get the Shading Dictionary from the name 
Sh0.

Again, pointers are MUCH appreciated.

> shfill operator needs implementation
> ------------------------------------
>
>                 Key: PDFBOX-615
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-615
>             Project: PDFBox
>          Issue Type: New Feature
>          Components: PDModel
>            Reporter: Daniel Wilson
>            Assignee: Daniel Wilson
>
> I have a PDF file (for which I do not yet have release permission) that uses 
> the "sh" operator, equivalent to PostScript's shfill (per PDF spec 1.7 page 
> 987).
> Adobe provides implementation guidance in a 78-page document at 
> http://www.adobe.com/devnet/postscript/pdfs/TN5600.SmoothShading.pdf#17
> I will be trying to add this functionality this week, but if anyone has 
> hints, suggestions, etc. they are most certainly welcome!

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to