I'm trying to automate some plotting routines in MicroStation to create a single pdf that may contain pages of different sizes (like what is possible through PrintOrganizer GUI).
I'm using the following code to try to retrieve different printer forms (paper sizes) to apply to CadPrintDefintions.
foreach (IPrintDefinition printDefinition in printSet.GetPrintDefinitionList(null, true)) { CadPrintDefinition cadPrintDefinition = (CadPrintDefinition)printDefinition; IPrinterForm printerForm = printer.FindFormByName(formName); //form name is a string that matches what is defined in our pltcfg file for form names cadPrintDefinition.PrinterForm = printerForm; //above line returns null for all formnames except "11X17" cadPrintDefinition.Maximize(); cadPrintDefinition.IsRasterized = false; }
Below is the snipped of our pltcfg file that defines our form names. (can't use insert code because is hides the tags)
<Forms>
<Form>
<DisplayName>8.5X11</DisplayName>
<Size>11,8.5,0</Size>
<Units>6</Units>
</Form>
<Form>
<DisplayName>8.5X14</DisplayName>
<Size>14,8.5,0</Size>
<Units>6</Units>
</Form>
<Form>
<DisplayName>11X17</DisplayName>
<Size>11,17,0</Size>
<Margins/>
<Units>6</Units>
<IsDefault>True</IsDefault>
</Form>
<Form>
<DisplayName>24X36</DisplayName>
<Size>36,24,0</Size>
<Margins/>
<FormNumber>0</FormNumber>
<Units>6</Units>
</Form>
<Form>
<DisplayName>36X48</DisplayName>
<Size>48,36,0</Size>
<Units>6</Units>
</Form>
<Form>
<DisplayName>36X72</DisplayName>
<Size>72,36,0</Size>
<Units>6</Units>
</Form>
</Forms>
I assumed the FormName parameter for the Printer.FindFormByName is the display name defined in the pltcfg. For some reason the only form that can be found by the code is "11x17", all others return null.
Am I passing the wrong information? I'm assuming the 11x17 might be working because it is set to IsDefault = true.