Rust를 사용하여 PDF 파일을 다른 형식으로 변환하는 방법을 찾고 계십니까?C++를 통한 Rust용 Aspose.PDF 파일은 PDF 문서를 변환하기 위한 완벽한 솔루션입니다.이 글은 Rust를 사용하여 PDF를 텍스트로 변환하는 방법을 보여줍니다.PDF 파일을 다른 형식으로 변환할 때 사용자는 종종 PDF 내용을 편집할 수 있기를 원합니다.C++를 통한 Rust용 Aspose.PDF 파일을 사용하면 PDF 문서를 가장 인기 있는 형식으로 쉽고 빠르게 변환할 수 있습니다.당사의 라이브러리를 통해 PDF 파일을 정확하고 성공적으로 변환할 수 있습니다.
PDF를 DOC로 변환
use asposepdf::Document;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open a PDF-document with filename
let pdf = Document::open("sample.pdf")?;
// Convert and save the previously opened PDF-document as DocX-document
pdf.save_docx("sample.docx")?;
Ok(())
}
러스트용 Aspose.PDF 는 PDF에서 DOC로의 변환을 지원합니다.먼저 PDF 문서를 엽니다.그런 다음 save_docx 함수를 호출합니다.다음으로 PDF 문서를 닫고 할당된 리소스를 모두 해제합니다.
PDF를 XSLX로 변환
use asposepdf::Document;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open a PDF-document with filename
let pdf = Document::open("sample.pdf")?;
// Convert and save the previously opened PDF-document as XlsX-document
pdf.save_xlsx("sample.xlsx")?;
Ok(())
}
이 코드는 Aspose.PDF 파일을 사용하여 PDF 파일을 엑셀 파일로 변환하는 Rust 함수입니다.먼저 PDF 문서를 엽니다.그런 다음 save_xlsx 함수를 호출합니다.다음으로 PDF 문서를 닫고 할당된 리소스를 모두 해제합니다.
PDF를 XPS로 변환
use asposepdf::Document;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open a PDF-document with filename
let pdf = Document::open("sample.pdf")?;
// Convert and save the previously opened PDF-document as Xps-document
pdf.save_xps("sample.xps")?;
Ok(())
}
이 Rust 함수는 Aspose.PDF 파일을 사용하여 PDF 파일을 XPS 파일로 변환합니다.먼저 PDF 문서를 엽니다.그런 다음 save_xps 함수를 호출합니다.다음으로, PDF 문서를 닫고 할당된 리소스를 모두 해제합니다.
PDF를 PNG로 변환
use asposepdf::Document;
fn main() -> Result<(), Box<dyn std::error::Error>> {
// Open a PDF-document with filename
let pdf = Document::open("sample.pdf")?;
// Convert and save the specified page as Png-image
pdf.page_to_png(1, 100, "sample_page1.png")?;
Ok(())
}
이 코드는 Aspose.PDF 파일을 사용하여 PDF 파일을 PNG 이미지로 변환하는 Rust 함수입니다.먼저 PDF 문서를 엽니다.그런 다음 page_to_png 함수를 호출합니다.다음으로 PDF 문서를 닫고 할당된 리소스를 모두 해제합니다.