Convert PDF To SWF FLASH - Asp Net MVC

Asked

Viewed 89 times

2

Good evening, I am generating pdf using Itextsharp and need to send to the client a swf, however I am struggling, in the client is a blank flash screen. I am using this strategy because with flash I can block the options to print the pdf and save as. Some ninja programmer would have some tip on how to do this?

  • You are having difficulty generating the PDF or displaying it inside a SWF container?

  • The pdf is generated and routine to display the swf as well. My difficulty is in converting the pdf to swf.

2 answers

0

I found this tool here.

The code below, according to this question here and this other topic here, does the conversion:

int pageNumber = 1;
string filename = @"MeuArquivo.pdf";
string outputfile = @"ArquivoConvertido.swf";
System.Diagnostics.Process pdf2swfprocess = new System.Diagnostics.Process();
pdf2swfprocess.StartInfo.UseShellExecute = false;
pdf2swfprocess.StartInfo.RedirectStandardOutput = true;
pdf2swfprocess.StartInfo.CreateNoWindow = true;
pdf2swfprocess.EnableRaisingEvents = false;
pdf2swfprocess.StartInfo.WorkingDirectory = HttpContext.Current.Server.MapPath("~");
pdf2swfprocess.StartInfo.RedirectStandardError = true;
pdf2swfprocess.StartInfo.FileName = HttpContext.Current.Server.MapPath("~/PDF2SWF/pdf2swf.exe");
//pdf2swfprocess.StartInfo.Arguments = inputfile + "-o" + outputfile;
pdf2swfprocess.StartInfo.Arguments = "\"" + HttpContext.Current.Server.MapPath("~/PDF2SWF/FONTS") + "\"" + " -p " + pageNumber + " " + filename + " -o " + filename + pageNumber + ".swf";

pdf2swfprocess.Start();
pdf2swfprocess.WaitForExit();
pdf2swfprocess.Close();
  • This code does not work Gypsy, does not generate expetions and does not generate the archive

  • Tried to run the executable in hand before? I believe the answer is to improve this code.

  • Opa, it functioned by running the command pdf2swf.exe indicator.pdf -o test.swf -f -T 9 -t -G -s . It only has one detail that is not good, when I open the swf file in a flash editor it is jumping automatically the pages.It would be nice to be able to add a button to change manually.

  • Does anyone have any idea how to remove it? on the wiki (wiki.swftools.org/wiki/Pdf2swf) of the Pdf2swf parameters does not reference how to add a bar e On that blog (http://blogwork.neteos.eu/examples/view.php) and its swf appears in a bar.

-1

I found the answer need to run two commands. The first to generate the swf and the second command to combine the generated swf with some standard model. 1) pdf2swf.exe indicator.pdf -the test.swf 2) swfcombine.exe C: swftools Rfxview.swf viewport=plan1.swf -the plan1.swf

  • And what about this in code? This answers only half the question. In this case, your application has to call the process and collect the output result.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.