문제

C# 응용 프로그램에서 PDF에 SWF를 프로그래밍 방식으로 포함시킬 수 있습니까?

도움이 되었습니까?

해결책

ITEXT 라이브러리의 C# 포트를 사용할 수 있습니다. ItextSharp라고합니다.

http://itextsharp.com/

코드가 어떻게 보일 수 있는지에 대한 예입니다.

 // create an output file stream which will be used to capture the generated file 
    string outputFileName = "output.pdf"; 
    FileStream outputFile = new FileStream(outputFileName, FileMode.Create); 

    // open the original pdf file as a PdfReader 
    PdfReader reader = new PdfReader("inputfile.pdf"); 

    // open the output pdf file as a PdfStamper 
    PdfStamper stamper = new PdfStamper(reader, outputFile); 

    // inserts a blank page at the start of the document 
    stamper.InsertPage(1, PageSize.A4); 

    // add the flash file to the output document as an annotation 
    PdfFileSpecification fs = PdfFileSpecification.FileEmbedded(stamper.Writer, flashFileTextBox.Text, flashFileTextBox.Text, null); 
    PdfAnnotation flashInsert = PdfAnnotation.CreateScreen(stamper.Writer, new Rectangle(50f,791f,545f,420f),"Flash Insert",fs, "application/x-shockwave-flash", true); 

    stamper.AddAnnotation(flashInsert,1); 

    stamper.Close(); 
    reader.Close(); 

다른 팁

Flash SWF 파일은 프로그래밍 방식으로 PDF 문서에 포함시킬 수 있습니다. PDF 라이브러리를 살펴보십시오 WebSupergoo. 문서에는 C# 및 vb.net의 예가 포함되어 있습니다.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top