Q
Q. John Chen
All,
I am using .NET/C# try to automate the export to pdf process. But
always got:
System.ArgumentException: Value does not fall within the expected
range.
There are so many arguments and I don't know which one causes the
problem.
Following are the arguments.
document.ExportAsFixedFormat(
Microsoft.Office.Interop.Publisher.PbFixedFormatType.pbFixedFormatTypePDF,
pdfPath /* Filename*/,
Microsoft.Office.Interop.Publisher.PbFixedFormatIntent.pbIntentPrinting,
false /* IncluceDocumentProperties */ ,
0 /*300*/ /* ColorDownsampleTarget */, // was using 300
dpi as found when I manually export.
0 /*450*/ /* ColorDownsampleThreshold */,
0 /*1200*/ /* OneBitDownsampleTarget */ ,
0 /*1800*/ /* OneBitDownsampleThreashold */,
1 /* From */ ,
document.Pages.Count /* To */ , // I tried
document.Pages.Count - 1 in case it's 0 based
1 /* Copies */ ,
false /* Collate */ ,
//
Microsoft.Office.Interop.Publisher.PbPrintStyle.pbPrintStyleDefault,
Microsoft.Office.Interop.Publisher.PbPrintStyle.pbPrintStyleOnePagePerSheet, //
the above do not work either.
false /* DocStructureTags */ ,
false /* BitmapMissingFonts */ ,
false /* UseISO19005_1 */ ,
null /* ExternalExporter */ );
Thanks
John
I am using .NET/C# try to automate the export to pdf process. But
always got:
System.ArgumentException: Value does not fall within the expected
range.
There are so many arguments and I don't know which one causes the
problem.
Following are the arguments.
document.ExportAsFixedFormat(
Microsoft.Office.Interop.Publisher.PbFixedFormatType.pbFixedFormatTypePDF,
pdfPath /* Filename*/,
Microsoft.Office.Interop.Publisher.PbFixedFormatIntent.pbIntentPrinting,
false /* IncluceDocumentProperties */ ,
0 /*300*/ /* ColorDownsampleTarget */, // was using 300
dpi as found when I manually export.
0 /*450*/ /* ColorDownsampleThreshold */,
0 /*1200*/ /* OneBitDownsampleTarget */ ,
0 /*1800*/ /* OneBitDownsampleThreashold */,
1 /* From */ ,
document.Pages.Count /* To */ , // I tried
document.Pages.Count - 1 in case it's 0 based
1 /* Copies */ ,
false /* Collate */ ,
//
Microsoft.Office.Interop.Publisher.PbPrintStyle.pbPrintStyleDefault,
Microsoft.Office.Interop.Publisher.PbPrintStyle.pbPrintStyleOnePagePerSheet, //
the above do not work either.
false /* DocStructureTags */ ,
false /* BitmapMissingFonts */ ,
false /* UseISO19005_1 */ ,
null /* ExternalExporter */ );
Thanks
John