<?PHP
$objUDC = new COM("UDC.APIWrapper");
$itfPrinter = $objUDC->Printers("Universal Document Converter");
$itfProfile = $itfPrinter->Profile;
$itfProfile->PageSetup->ResolutionX = 300;
$itfProfile->PageSetup->ResolutionY = 300;
$itfProfile->PageSetup->Orientation = 0;
$itfProfile->FileFormat->ActualFormat = 7;
$itfProfile->FileFormat->PDF->ColorSpace = 24;
$itfProfile->FileFormat->PDF->Compression = 4;
$itfProfile->FileFormat->PDF->Multipage = 2;
$itfProfile->OutputLocation->Mode = 1;
$itfProfile->OutputLocation->FolderPath = '&[Documents]\UDC Output Files\\';
$itfProfile->OutputLocation->FileName = '&[DocName(0)].&[ImageType]';
$itfProfile->OutputLocation->OverwriteExistingFile = 1;
$itfProfile->Adjustments->Crop->Mode = 0;
$itfProfile->PostProcessing->Mode = 0;
$itProfile->ShowProgressWnd = 1;
$file = 'my_chart.dwg';
$ACADApp = new COM("AutoCAD.Application");
$Drawing = $ACADApp->Documents->Open($file,false);
If ($Drawing->ActiveSpace = 0){
$Layout = $Drawing->PaperSpace->Layout;
}
Else {
$Layout = $Drawing->ModelSpace->Layout;
}
$Layout->PlotType = 1;
$Layout->UseStandardScale = True;
$Layout->StandardScale = 0;
$Layout->CenterPlot = True;
$Drawing->SetVariable("BACKGROUNDPLOT", 0);
$Drawing->SetVariable("FILEDIA", 0);
$Drawing->SetVariable("CMDDIA", 0);
$Drawing->Plot->QuietErrorMode = True;
$Drawing->Plot->PlotToDevice("Universal Document Converter");
sleep(5);
$Drawing->Close(False);
$ACADApp->Quit();
echo "READY!";
?>
|