I have tried replicating the issue using shared code snippet but as there are many custom variables defined and in order to replicate the issue, we need some sample project and input PDF document. We are sorry for this inconvenience.
i was afraid, that would happen so i prepared a .rar with the Project, an Input XML file and the matching Output Pdf. I used VS 2012.
Some stuff in the Project is in german so you could have some Trouble understanding the comments.
When starting my program a gui will open. Just use the FilePicker to get my Input XML into the sourcefile, leave Destfile blank as it sets itself. Choose "Pdf erstellen" at the Options, ignore the Checkbox and cklick "Go".
The created Pdf should open after a few seconds.
In the Pdf you should be able to see the lines i want to fill with Color. I know my Project is kinda complex but I hope you can understand what i want to do now.