I use the DOM functions of the .NET library to build a list project ‘on the fly’ after the user made some choices like the printer, the paper format, orientation etc.
This is the code:
private void TestDomFunctions() {
ListLabel ll = new ListLabel();
PageSetupDialog pageDialog = new PageSetupDialog();
pageDialog.PrinterSettings = new PrinterSettings();
pageDialog.PageSettings = new PageSettings(pageDialog.PrinterSettings);
pageDialog.ShowNetwork = true;
pageDialog.AllowMargins = true;
pageDialog.EnableMetric = false;
DialogResult result = pageDialog.ShowDialog();
if (result == DialogResult.OK) {
PrinterSettings printer = pageDialog.PrinterSettings;
PageSettings page = pageDialog.PageSettings;
ProjectList Project = new ProjectList(ll);
Project.Open("c:\\test.lst", LlDomFileMode.Create, LlDomAccessMode.ReadWrite, true);
Project.Regions[0].Set(printer, page);
ObjectText objTitle = new ObjectText(Project.Objects);
Paragraph objTitleContents = new Paragraph(objTitle.Paragraphs);
objTitleContents.Contents = "'DOM Test'";
objTitle.Position.Set(10000, 10000, 30000, 10000);
Project.Save();
Project.Close();
ll.Design("Design", LlProject.List, "c:\\test.lst", false);
}
}
This code works fine until the 15.005b service pack.
If I install the 15.006 or the 15.007 sp, when I try change the page size, orientation or any other setting into dialog, the changes are ignored and the designer show up the default page of the printer (A4 vertical in my case).
So it is a bug, or there is another way to do this?