CADToPDF exports a blank page
Moderators: SDS, support, admin
CADToPDF exports a blank page
I am using the demo library, but I'm told that it should be fully functional. The code executes without any obvious errors, but the PDF file I get as output is simply a blank file.
My code is this:
Please help? Thanks in advance!
EBrown Posts: 1Joined: 57 minutes ago
My code is this:
Code: Select all
public bool SaveToPDF(string strSrc, string strDest) {
bool success = false;
try {
CADImage img = new CADImage();
img.UseDoubleBuffering = false;
img.GraphicsOutMode = DrawGraphicsMode.Export;
img.LoadFromFile(strSrc);
img.GetExtents();
CADImport.Export.CADToPDF c2p = new CADImport.Export.CADToPDF(img);
if (System.IO.File.Exists(strDest)) File.Delete(strDest);
c2p.SaveToFile(strDest);
success = true;
} catch (Exception ex) {
}
return success;
}
Please help? Thanks in advance!
EBrown Posts: 1Joined: 57 minutes ago
Re: CADToPDF exports a blank page
Hello.
CAD Import .NET provides a set of classes for import different formats. Each class must be used to import corresond format. For example CADImage class provided for import DXF files, DWGImage - for import DWG. An attempt to import file of other than DXF format with your code will result in blank screen visualization. Further export to PDF will generate a blank page.
Generally we recommend to call CADImage.CreateImageByExtension method that creates object of required class for specified file extention.
Alexander.
CAD Import .NET provides a set of classes for import different formats. Each class must be used to import corresond format. For example CADImage class provided for import DXF files, DWGImage - for import DWG. An attempt to import file of other than DXF format with your code will result in blank screen visualization. Further export to PDF will generate a blank page.
Generally we recommend to call CADImage.CreateImageByExtension method that creates object of required class for specified file extention.
Code: Select all
try {
CADImage img = CADImage.CreateImageByExtension(strSrc);
img.UseDoubleBuffering = false;
...
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support
Re: CADToPDF exports a blank page
Wonderful! That did the trick.
It would be useful if the documentation commented on this being the better way to load an existing file.
Thanks!
It would be useful if the documentation commented on this being the better way to load an existing file.
Thanks!
Re: CADToPDF exports a blank page
Hello.
Thank you for the remark, we will take it into account.
Alexander.
Thank you for the remark, we will take it into account.
Alexander.
Technical Support E-mail: support@cadsofttools.com
Chat support on Skype: cadsofttools.support
Chat support on Skype: cadsofttools.support