Pergunta

É possível programaticamente incorporar um SWF em um PDF a partir de um aplicativo C #?

Foi útil?

Solução

Você pode usar a porta c # da biblioteca iText. É chamado iTextSharp.

http://itextsharp.com/

Um exemplo do que o código poderia ser semelhante a:

 // 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(); 

Outras dicas

arquivos SWF do Flash pode ser incorporado em um documento PDF por meio de programação. Ter um olhar para a biblioteca PDF de WebSupergoo . A documentação inclui exemplos em C # e VB.NET.

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top