많은 rdlc 보고서를 .net 프레임 워크의 하나의 큰 pdf로 병합하여 보고서 책을 만드는 방법이 있습니까? 보통 우리는 pdfs를 rdlc 보고서로 생성하기 위해 Datasource를 전달한 다음 pdf 형식으로 렌더링합니다. 그래서 렌더링하는 동안 여러 rdlc가 pdfs를 병합 할 수 있습니까? SSRS (SQL Server Reporting Service)를 사용하여 생성 된 pdfs를 병합 할 수있는 도구가 있습니까?SSRS 및 ASP.NET을 사용하여 Pdf 형식으로 생성 된 보고서 병합
2
A
답변
0
http://khsw.blogspot.com/2006/04/merge-pdf-files-using-itextsharp.html에 코드를 사용하여 여러 기존 PDF를 단일 문서로 병합했습니다.
0
PDF를 iTextSharp와 병합 할 수 있다는 것을 알고 있습니다. 다음과 같이 시도하십시오.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
namespace Components.Pdf
{
public class PdfDocumentMerger
{
private List<string> sourceFileList;
#region constructors
public PdfDocumentMerger()
{
//initialize the source file list
sourceFileList = new List<string>();
}
public PdfDocumentMerger(params string[] fileNames) : this()
{
sourceFileList.AddRange(fileNames.AsEnumerable<string>());
}
#endregion
/// <summary>
/// Merges multiple PDF documents into one document
/// </summary>
/// <param name="DestinationFileName">The name and path to the merged document</param>
/// <returns>The name and path to the merged document, if successful. Otherwise, the return value is an empty string</returns>
public string Merge(string destinationFileName)
{
try
{
int sourceIndex = 0;
PdfReader reader = new PdfReader(sourceFileList[sourceIndex]);
int sourceFilePageCount = reader.NumberOfPages;
Document doc = new Document(reader.GetPageSizeWithRotation(1));
PdfWriter writer = PdfWriter.GetInstance(doc, new FileStream(destinationFileName, FileMode.Create));
doc.Open();
PdfImportedPage page;
PdfContentByte contentByte = writer.DirectContent;
int rotation;
while (sourceIndex < sourceFileList.Count)
{
int pageIndex = 0;
while (pageIndex < sourceFilePageCount)
{
pageIndex++;
doc.SetPageSize(reader.GetPageSizeWithRotation(pageIndex));
doc.NewPage();
page = writer.GetImportedPage(reader, pageIndex);
rotation = reader.GetPageRotation(pageIndex);
if (rotation.Equals(90 | 270))
contentByte.AddTemplate(page, 0, -1f, 1f, 0, 0, reader.GetPageSizeWithRotation(pageIndex).Height);
else
contentByte.AddTemplate(page, 1f, 0, 0, 1f, 0, 0);
}
sourceIndex++;
if (sourceIndex < sourceFileList.Count)
{
reader = new PdfReader(sourceFileList[sourceIndex]);
sourceFilePageCount = reader.NumberOfPages;
}
}
doc.Close();
}
catch
{
throw;
}
return destinationFileName;
}
}
}
관련 문제
- 1. SSRS 및 캐시 된 보고서
- 2. PHP에서 PDF 보고서 생성
- 3. 인쇄 미리보기 PDF 형식의 SSRS 보고서
- 4. SSRS 2008 거대한 pdf 보고서, 빈 페이지
- 5. C# 프로그램을 사용하여 SSRS 보고서 생성
- 6. SSRS 보고서 관리자에서 보고서 내보내기
- 7. Java에서 PDF 보고서 생성
- 8. 보고서 및 차트 병합
- 9. ssrs 파생 된 보고서
- 10. C# 개체에서 SSRS 보고서 생성
- 11. 파이썬에서 PDF 파일 생성 및 병합
- 12. 오리너구리를 사용하여 간단한 PDF 보고서 생성
- 13. 텍스트 및 차트 기반 데이터가 포함 된 PDF 보고서 생성
- 14. 동적 PDF 및 ASP.net을 통해 액세스 가능
- 15. SSRS 보고서 작성기 및 Firefox
- 16. SSRS PDF 내보내기시 손상 됨
- 17. SSRS 보고서 자동 인쇄
- 18. 인터넷 직면 SSRS 보고서
- 19. 간단한 SSRS 보고서
- 20. PDF 텍스트 추가 및 병합
- 21. SSRS 보고서 관리자 보고서 이름
- 22. 보고서 생성
- 23. C# 코드에서 매개 변수화 된 SSRS 보고서 내보내기
- 24. Reporting Services 2005 PDF 보고서 생성 및 디스크에 저장
- 25. SSRS 보고서 개발 도구
- 26. 임시 SSRS 보고서 정리
- 27. PDF 형식으로 SSRS 내보내기 다른 VS 배포 대 배포
- 28. ssrs 특별 보고서 이동
- 29. PDFTK없이 FDF 및 PDF 병합
- 30. CSRS로 SSRS 보고서 내보내기
위의 내용은 pdf가 물리적으로 존재하고 병합되어야 함을 요구합니다. 만약 우리가 merge하기 위해 pdf로 localreport를 렌더링하는 바이트 스트림을 사용하고 pdf로 렌더링하는 것은 가능합니다. – zain
바이트 배열로 작업 할 수 있습니까? http://pastebin.com/qbw95cad –