iLogic Save As PDF color option not working

iLogic Save As PDF color option not working

whunter
Advocate Advocate
1,091 Views
4 Replies
Message 1 of 5

iLogic Save As PDF color option not working

whunter
Advocate
Advocate

HI all;

 

I've hacked together a version of the Save As PDF code that floats around on these forums and other places. Everything works except the color option. I want to save my PDFs as All Colors As Black, but setting the option to 0 or 1 doesn't work, it keeps saving the PDFs in color. Here's the snippet of code:

 

If oPDFAddIn.HasSaveCopyAsOptions(oDataMedium, oContext, oOptions) Then
oOptions.Value("All_Color_As_Black") = True
oOptions.Value("Remove_Line_Weights") = False
oOptions.Value("Vector_Resolution") = 400
oOptions.Value("Sheet_Range") = Inventor.PrintRangeEnum.kPrintAllSheets
'oOptions.Value("Custom_Begin_Sheet") = 2
'
oOptions.Value("Custom_End_Sheet") = 4
End If

What is wrong with the option in the second line (shown in red)? I've tried a few other variations of All_Color_As_Black, but I'm having no joy. All the other examples I've looked at either has that option set to False (0) or that line is commented out (I wonder why...)

 

I'd really appreciate some help.

 

Thanks,

William

0 Likes
Accepted solutions (1)
1,092 Views
4 Replies
Replies (4)
Message 2 of 5

skyngu
Collaborator
Collaborator

it is a Boolean value. only true or false.

Autodesk Inventor Professional 2019
0 Likes
Message 3 of 5

Curtis_W
Consultant
Consultant
Accepted solution

Hi whunter, 

 

It works for me using:

oOptions.Value("All_Color_AS_Black") = True

or

oOptions.Value("All_Color_AS_Black") = 1

 

But here's the rub, this option only controls line color. That means if you're using shaded view, the shading will not be set to B&W, but the line colors for the model edges, dimensions, etc,  will be converted to black. So more than likely it's working for you, but it might not be working as you expected it to. You can right-click on any model edge in the drawing and choose Properties to change the line color to test this.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

 

EESignature

0 Likes
Message 4 of 5

Curtis_W
Consultant
Consultant

Hi whunter,

 

I'll add that you can install a PDF print driver (such as Cute PDF), and set it up to print everything (shading and all) in B&W. I'm not sure if that helps with what you're doing though.

 

I hope this helps.
Best of luck to you in all of your Inventor pursuits,
Curtis
http://inventortrenches.blogspot.com

 

EESignature

0 Likes
Message 5 of 5

whunter
Advocate
Advocate

Hi Curtis,

 

Thanks, I got it to work last night. I didn't realise that the "_As_" bit is supposed to be "_AS_" (all caps) for it to work (I mean I didn't realise it's case sensitive). It's a bit odd.

--

William

0 Likes