Can anyone explain why the following code runs with no errors, the debug shows correct DeviceGray values, consistent with the content of the PDF, but yet the OUTPUT has no change.
My goal is to change "fill" values of content objects.
Dim outputfile As String = "C:\output.pdf"
Dim file As New File("C:\inputfile.pdf")
Dim document As Document = file.Document
For Each page As Page In document.Pages
Dim contents As Contents = page.Contents
For Each obj As ContentObject In contents
Private Sub AdjustFillValue(content As ContentObject)
If TypeOf content Is ContainerObject Then
For Each obj As ContentObject In DirectCast(content, ContainerObject).Objects
ElseIf TypeOf content Is SetDeviceCMYKFillColor Then
'... to implement
ElseIf TypeOf content Is SetDeviceGrayFillColor Then
Dim FillColor As SetDeviceGrayFillColor = DirectCast(content, SetDeviceGrayFillColor)
Debug.WriteLine("GrayFill=" & FillColor.ToString()) 'VALUES RETURN OK (0 to 1 range)
'DEBUG PROVES INPUT PDF HAS DEVICEGRAY COLOR CONTENT
FillColor = New SetDeviceGrayFillColor(New colorSpaces.DeviceGrayColor(0.1)) 'NO IMPACT ON OUTPUT
content = New SetDeviceGrayFillColor(New colorSpaces.DeviceGrayColor(0.1)) 'NO IMPACT ON OUTPUT
*How can I set new fillcolor ?*
ElseIf TypeOf content Is SetDeviceRGBFillColor Then
ElseIf TypeOf content Is SetFillColor Then
never mind, I figured this one out myself
assigning the fill object to a new objects breaks it
FillColor.Components(0) = .... works fine
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.