Print Page | Close Window

Trouble with ShadingType 4 (Gouraud Triangles)

Printed From: Foxit's Planet PDF Forum
Category: Lets Talk PDF
Forum Name: PDF Developers
Forum Description: This conference is for PDF developers.
URL: http://forums.planetpdf.com/forum_posts.asp?TID=2085
Printed Date: 21 Jul 2019 at 4:06am
Software Version: Web Wiz Forums 11.10 - http://www.webwizforums.com


Topic: Trouble with ShadingType 4 (Gouraud Triangles)
Posted By: JimBlack
Subject: Trouble with ShadingType 4 (Gouraud Triangles)
Date Posted: 24 Nov 2016 at 4:24pm
Hi,
I am generating a PDF file and cannot get Shading Type 4 to work.  Here is my shading-pattern object in the PDF file that I generated:
 
12 0 obj   % PdfSharp.Pdf.Advanced.PdfShadingPattern
<<
  /Matrix [1 0 0 1 0 0]
  /PatternType 2
  /Shading
  <<
    /ColorSpace /DeviceRGB
    /DataSource [0 411 210.1 0 2 247 187.6 1 2 575 187.6 1 2 575 232.6 1 2 247 232.6 1 2 247 187.6 1]
    /Function
    <<
      /C0 [0 0.875 0]
      /C1 [0 0.169 0]
      /Domain [0 1]
      /FunctionType 2
      /N 1
    >>
    /ShadingType 4
  >>
  /Type /Pattern
>>
endobj
 
When I apply this shading to a simple rectangle in my PDF file, the rectangle is not rendered.  I've tried to render both in Adobe Acrobat Reader 2015 and in GSView 5.0 and get no rectangle in either case.  On the other hand, if I insert my shading function into a simple PostScript file, it works!   Also, when I replaced the Type 4 shading by ShadingType 2 (linear gradient) in my PDF file, the rectangle renders.  So I'm wondering if there is some magic incantation that I need to perform in order to have Type 4 shading render in a PDF file? 


-------------
Thanks...Jim



Print Page | Close Window

Forum Software by Web Wiz Forums® version 11.10 - http://www.webwizforums.com
Copyright ©2001-2017 Web Wiz Ltd. - https://www.webwiz.net