DRC 도면
Contents
[
Hide
]DRC 도면을 PDF로 내보내기
Aspose.CAD는 AutoCAD DRC 도면 엔티티를 로드하고 이를 전체 도면으로 PDF 형식으로 렌더링하는 기능을 제공합니다. DRC에서 PDF로의 변환 방법은 다음과 같습니다:
- Image.Load 팩토리 메서드를 사용하여 DRC 도면 파일을 로드합니다.
- CadRasterizationOptions 클래스의 객체를 만들고 PageHeight 및 PageWidth 속성을 설정합니다.
- PdfOptions 클래스의 객체를 만들고 VectorRasterizationOptions 속성을 설정합니다.
- Image.Save를 호출하고 두 번째 매개변수로 PdfOptions 객체를 전달합니다.
샘플 코드
아래의 코드 샘플은 기본 설정을 사용하여 파일을 변환하는 방법을 보여줍니다.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
string inputFile ="file.drc"; | |
using (Image image = Image.Load(inputFile)) | |
{ | |
// Initialize PdfOptions class object | |
PdfOptions options = new PdfOptions(); | |
CadRasterizationOptions cadRasterizationOptions = new CadRasterizationOptions(); | |
cadRasterizationOptions.PageHeight = 500; | |
cadRasterizationOptions.PageWidth = 500; | |
options.VectorRasterizationOptions = cadRasterizationOptions; | |
// Export DRC to PDF | |
string outPath = "output.pdf"; | |
image.Save(outPath, options); | |
} |