C# 프로그래밍을 통해 테이블 내용 만 Excel로 내보내려면 어떻게합니까? 현재 PDFNET SDK를 사용하여 PDF에서 모든 내용을 추출하고 있지만 표를 표 형식의 구조로 읽을 수 없습니다.pdf에서 표를 내보내 Excel로 내보내기 하시겠습니까?
답변
나는 위의 솔루션을 시도했지만 그것을 밖으로 만들 수 없습니다. 너무 많은 무료 SDK 또는 DLL을 pdfnet, pdfclown, itextsharp, pdfbox, pdflib와 같이 사용할 수 있습니다. 마지막으로 pdfnet sdk로 다시 시도해 보았습니다. 내 입력 PDF가 pdf 형식의 태그 인 경우이를 수행 할 수 있습니다.
word.bbox() 및 line.bbox()를 사용하여 ... –
이 제품에는 SDK가 사용되지 않았지만 독립형 제품을 사용했습니다. . PDF의 내용을 스프레드 시트로 읽습니다 (많은 내보내기 옵션).
이 제품은 Nuance http://australia.nuance.com/for-business/by-product/omnipage/index.htm의 OmniPage입니다.
무료 평가판이있는 SDK가 있습니다.
우리가 아래로 전체 페이지를 추출 할 수 있습니다 bytescount PDF 추출기 SDK를 사용하여,
CSVExtractor extractor = new CSVExtractor();
extractor.RegistrationName = "demo";
extractor.RegistrationKey = "demo";
TableDetector tdetector = new TableDetector();
tdetector.RegistrationKey = "demo";
tdetector.RegistrationName = "demo";
// Load the document
extractor.LoadDocumentFromFile("C:\\sample.pdf");
tdetector.LoadDocumentFromFile("C:\\sample.pdf");
int pageCount = tdetector.GetPageCount();
for (int i = 1; i <= pageCount; i++)
{
int j = 1;
do
{
extractor.SetExtractionArea(tdetector.GetPageRect_Left(i),
tdetector.GetPageRect_Top(i),
tdetector.GetPageRect_Width(i),
tdetector.GetPageRect_Height(i)
);
// and finally save the table into CSV file
extractor.SavePageCSVToFile(i, "C:\\page-" + i + "-table-" + j + ".csv");
j++;
} while (tdetector.FindNextTable()); // search next table
}
가 이전 게시물이기 때문에, 그것은 다른 사람을 도움이되기를 바랍니다.
위의 답변 (John)은 효과적입니다.
하지만 코드를 사용하는 대신 bytescount PDF Extrator SDK 도구를 사용합니다.
그런데이 도구는 하나의 Excel 파일에 많은 시트를 생성합니다.
아래 코드를 Excel에서 사용하면 하나의 시트로 생성 할 수 있습니다.
Sub ConvertAsOne()
Application.ScreenUpdating = False
For j = 1 To Sheets.Count
If Sheets(j).Name <> ActiveSheet.Name Then
X = Range("A65536").End(xlUp).Row + 1
Sheets(j).UsedRange.Copy Cells(X, 1)
End If
Next
Range("B1").Select
Application.ScreenUpdating = True
MsgBox "succeed!", vbInformation, "note"
End Sub
- 1. 계층 격자를 Excel로 내보내기
- 2. ReportViewer에서 Excel로 내보내기 수정
- 3. XML로 내보내기 (Excel로 내보내기)
- 4. Excel로 내보내기
- 5. sharepoint - complex에서 excel로 내보내기
- 6. Crystal Reports X - Excel로 자동 내보내기 하시겠습니까?
- 7. ASP.NET Excel로 내보내기 - 셀 잠금
- 8. Excel로 데이터 집합 내보내기
- 9. 문제 DataGrid를 Excel로 내보내기
- 10. gridview에서 Excel로 내보내기
- 11. 레코드 집합을 Excel로 내보내기
- 12. SSRS : Excel로 내보내기?
- 13. Excel로 IQueryable 컬렉션 내보내기
- 14. 머리글없이 SSRS에서 Excel로 내보내기
- 15. 데이터 집합을 Excel로 내보내기
- 16. ASP.net MVC Excel로 내보내기
- 17. Excel로 액세스 쿼리 내보내기
- 18. SSRS 보고서를 Excel로 내보내기
- 19. 배열을 Excel로 내보내기
- 20. C# 목록을 Excel로 내보내기
- 21. vb.net에서 Excel로 데이터 내보내기
- 22. 수출 번호 필드 내보내기 문제를 Excel로 내보내기
- 23. 데이터를 내 데이터베이스에서 Excel로 내보내기
- 24. Access 테이블 데이터를 Excel로 내보내기
- 25. 구조가있는 Infopath 데이터를 Excel로 내보내기
- 26. 동적 HTML을 Excel로 내보내기 .NET
- 27. Crystal Reports를 사용하여 Excel로 내보내기
- 28. 프롬프트 창없이 Excel로 Gridview 내보내기
- 29. 여러 개의 gridview를 Excel로 내보내기
- 30. jqGrid ASP.net 2.0의 Excel로 내보내기
PDF로 된 실제 테이블 구조가 없습니다. 기본적으로 어떤 종류의 "표 인식"에 의존해야합니다 ... 정의에 따라 일부 정확하고 잘못된 결과가 나타납니다. – Yahia