Hello!
I am using the ActiveX interface of the CDIntf (version 2.06) and while I am able to set the JPEG compression of the output file (by setting JPEGCompression = true) I don't seem able to set the level of compression for JPEGs.
I've tried to set the "JPegLevel" property to all the values from 1 to 9 but I always get the same result.
Any ideas in regard?
Thanks,
- Marco
Unable to set image compression
Hi,
You can set Jpeg Compression and the compression level by adding the appropriate parameter to the call of FileNameOptions.
For more details please check Appendix D in the user manual "Amyuni PDF Converter.pdf"
Please note that you can use FileNameOptionsEx instead of FileNameOptions if you want to call this function with long parameters from the ActiveX interface of CDintf.
Hope this helps.
You can set Jpeg Compression and the compression level by adding the appropriate parameter to the call of FileNameOptions.
For more details please check Appendix D in the user manual "Amyuni PDF Converter.pdf"
Please note that you can use FileNameOptionsEx instead of FileNameOptions if you want to call this function with long parameters from the ActiveX interface of CDintf.
Hope this helps.
I will add a bit more of information so you can understand better my situation.
I am using C# and I want to print an Excel workbook to pdf using the CDIntf via COM interop. If I use this code:
If I try the following code (as you suggested):
Now, this is very important for me since my boss has to decide if buying your component or not in the next 48 hours. JPeg compression is not really a biggie for us but would greatly help in having a customizable output.
Thanks for any help,
- Marco
I am using C# and I want to print an Excel workbook to pdf using the CDIntf via COM interop. If I use this code:
it does work, but no matter which number I assing to the "JPegLevel" property I get always the same output.CDIntf.CDIntf pdfPrn = new CDIntf.CDIntfClass();
pdfPrn.DriverInit("PDFConverter");
pdfPrn.JPEGCompression = true;
pdfPrn.JPegLevel = (short)7;
pdfPrn.SetDefaultConfig();
excelWKBook.PrintOut(Missing.Value, Missing.Value, 1, false, "PDFConverter on LPT1:", true, false, strReportPath.ToString() + ".pdf");
pdfPrn.DriverEnd();
Marshal.ReleaseComObject(pdfPrn);
pdfPrn = null;
If I try the following code (as you suggested):
Excel hangs my application when I call the PrintOut method.CDIntf.CDIntf pdfPrn = new CDIntf.CDIntfClass();
pdfPrn.DriverInit("PDFConverter");
pdfPrn.DefaultFileName = strReportPath.ToString() + ".pdf";
pdfPrn.FileNameOptionsEx = 1 + 2 + 20000;
pdfPrn.SetDefaultConfig(); //<- with or without this does not make difference
excelWKBook.PrintOut(Missing.Value, Missing.Value, 1, false, "PDFConverter on LPT1:", true, false, strReportPath.ToString() + ".pdf");
pdfPrn.FileNameOptionsEx = 0;
pdfPrn.DriverEnd();
Marshal.ReleaseComObject(pdfPrn);
pdfPrn = null;
Now, this is very important for me since my boss has to decide if buying your component or not in the next 48 hours. JPeg compression is not really a biggie for us but would greatly help in having a customizable output.
Thanks for any help,
- Marco