Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.
이 문서에서는 C#을 사용하여 PDF를 Microsoft Word 문서로 변환하는 방법을 설명합니다. 다음 주제를 다룹니다.
형식: DOC
형식: DOCX
형식: Word
다음 코드 스니펫은 Aspose.PDF.Drawing 라이브러리와 함께 작동합니다.
가장 인기 있는 기능 중 하나는 PDF를 Microsoft Word DOC로 변환하는 것으로, 콘텐츠 관리를 더 쉽게 만들어 줍니다. Aspose.PDF for .NET는 PDF 파일을 DOC 및 DOCX 형식으로 빠르고 효율적으로 변환할 수 있게 해줍니다.
PDF 파일을 DOC 형식으로 쉽게 변환하고 완벽한 제어를 할 수 있습니다. Aspose.PDF for .NET는 유연하며 다양한 변환을 지원합니다. 예를 들어, PDF 문서의 페이지를 이미지로 변환하는 것은 매우 인기 있는 기능입니다.
많은 고객들이 PDF에서 DOC로의 변환을 요청했습니다: PDF 파일을 Microsoft Word 문서로 변환하는 것입니다. 고객들은 PDF 파일은 쉽게 편집할 수 없고 Word 문서는 편집할 수 있기 때문에 이를 원합니다. 일부 회사는 사용자가 PDF에서 시작된 파일의 텍스트, 표 및 이미지를 조작할 수 있기를 원합니다.
간단하고 이해하기 쉽게 만드는 전통을 이어가며, Aspose.PDF for .NET는 소스 PDF 파일을 DOC 파일로 변환하는 데 두 줄의 코드만 필요합니다. 이 기능을 구현하기 위해 SaveFormat이라는 열거형을 도입하였으며, 그 값 .Doc은 소스 파일을 Microsoft Word 형식으로 저장할 수 있게 해줍니다.
다음 C# 코드 스니펫은 PDF 파일을 DOC 형식으로 변환하는 방법을 보여줍니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPDFtoWord()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Open PDF document
usnig (var document = new Aspose.Pdf.Document(dataDir + "PDFToDOC.pdf"))
{
// Save the file into MS document format
document.Save(dataDir + "PDFToDOC_out.doc", SaveFormat.Doc);
}
}
DocSaveOptions
클래스는 PDF 파일을 DOC 형식으로 변환하는 데 도움이 되는 여러 속성을 제공합니다. 이러한 속성 중 Mode는 PDF 콘텐츠의 인식 모드를 지정할 수 있게 해줍니다. 이 속성에 대해 RecognitionMode 열거형의 값을 선택할 수 있습니다. 이러한 값 각각은 특정 이점과 제한이 있습니다:
Textbox
모드는 빠르고 PDF 파일의 원래 모양을 유지하는 데 좋지만, 결과 문서의 편집 가능성이 제한될 수 있습니다. 원본 PDF의 시각적으로 그룹화된 텍스트 블록은 출력 문서에서 텍스트 상자로 변환됩니다. 이는 원본과 최대한 유사하게 만들어 주므로 출력 문서가 보기 좋지만, 전적으로 텍스트 상자로 구성되어 있어 Microsoft Word에서 편집하기가 상당히 어렵습니다.Flow
모드는 전체 인식 모드로, 엔진이 그룹화 및 다단계 분석을 수행하여 원본 문서를 작성자의 의도에 따라 복원하면서 쉽게 편집할 수 있는 문서를 생성합니다. 제한 사항은 출력 문서가 원본과 다르게 보일 수 있다는 것입니다.RelativeHorizontalProximity
속성은 텍스트 요소 간의 상대적 근접성을 제어하는 데 사용할 수 있습니다. 이는 거리가 글꼴 크기로 정규화된다는 것을 의미합니다. 더 큰 글꼴은 음절 간의 간격이 더 클 수 있으며 여전히 하나의 전체로 간주됩니다. 이는 글꼴 크기의 백분율로 지정됩니다; 예를 들어, 1 = 100%. 이는 12pt 간격으로 배치된 12pt의 두 문자가 근접하다는 것을 의미합니다.
RecognitionBullets
는 변환 중에 글머리 기호 인식을 활성화하는 데 사용됩니다.// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPDFtoWordDocAdvanced()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "PDF-to-DOC.pdf"))
{
var saveOptions = new Aspose.Pdf.DocSaveOptions
{
// Set format to save MS document
Format = Aspose.Pdf.DocSaveOptions.DocFormat.Doc,
// Set the recognition mode as Flow
Mode = Aspose.Pdf.DocSaveOptions.RecognitionMode.Flow,
// Set the Horizontal proximity as 2.5
RelativeHorizontalProximity = 2.5f,
// Enable the value to recognize bullets during the conversion process
RecognizeBullets = true
};
// Save the file into MS document with save options
document.Save(dataDir + "PDFtoDOC_out.doc", saveOptions);
}
}
Aspose.PDF for .NET API는 C# 및 모든 .NET 언어를 사용하여 PDF 문서를 DOCX로 읽고 변환할 수 있게 해줍니다. DOCX는 구조가 일반 이진 파일에서 XML 및 이진 파일의 조합으로 변경된 Microsoft Word 문서의 잘 알려진 형식입니다. Docx 파일은 Word 2007 및 이후 버전에서 열 수 있지만, 이전 버전의 MS Word에서는 DOC 파일 확장자를 지원하지 않습니다.
다음 C# 코드 스니펫은 PDF 파일을 DOCX 형식으로 변환하는 방법을 보여줍니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPDFtoWord_DOCX_Format()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "PDFToDOC.pdf"))
{
// Save the file into MS document format
document.Save(dataDir + "PDFtoDOC_out.docx", SaveFormat.DocX);
}
}
PDF를 DOCX로 변환할 때 더 나은 결과를 얻으려면 EnhancedFlow
모드를 사용할 수 있습니다.
Flow와 Enhanced Flow의 주요 차이점은 테이블(테두리가 있는 것과 없는 것 모두)이 실제 테이블로 인식된다는 것입니다. 즉, 배경에 그림이 있는 텍스트가 아닙니다.
번호 매기기 목록 및 기타 여러 작은 항목도 인식됩니다.
// For complete examples and data files, visit https://github.com/aspose-pdf/Aspose.PDF-for-.NET
private static void ConvertPDFtoWord_Advanced_DOCX_Format()
{
// The path to the documents directory
var dataDir = RunExamples.GetDataDir_AsposePdf();
// Open PDF document
using (var document = new Aspose.Pdf.Document(dataDir + "PDFToDOC.pdf"))
{
// Instantiate DocSaveOptions object
DocSaveOptions saveOptions = new Aspose.Pdf.DocSaveOptions
{
// Set format to save MS document
Format = Aspose.Pdf.DocSaveOptions.DocFormat.DocX,
// Set the recognition mode as EnhancedFlow
Mode = Aspose.Pdf.DocSaveOptions.RecognitionMode.EnhancedFlow
};
// Save the file into MS document format
document.Save(dataDir + "PDFToDOC_out.docx", saveOptions);
}
}
이 문서에서는 다음 주제도 다룹니다. 코드는 위와 동일합니다.
형식: Word
형식: DOC
형식: DOCX
Analyzing your prompt, please hold on...
An error occurred while retrieving the results. Please refresh the page and try again.