|
[C#]
Doc doc = new Doc();
using(SwfImportOperation operation = new SwfImportOperation())
{
operation.Doc = doc;
operation.ContentAlign = ContentAlign.Top;
operation.ContentScaleMode =
ContentScaleMode.ShowAll;
operation.ProcessingObject += delegate(object sender,
ProcessingObjectEventArgs e) {
if(e.Info.SourceType==ProcessingSourceType.MultiFrameImage
&& e.Info.FrameNumber.HasValue)
e.Info.FrameNumber =
1+(long)(e.Info.FrameRate.Value*3.5);
}
operation.Import(Server.MapPath("ABCpdf.swf"));
}
doc.Save(Server.MapPath("swf.pdf"));
doc.Clear();
[Visual Basic]
Dim theDoc As Doc = New Doc()
Using theOperation As New SwfImportOperation
theOperation.Doc = theDoc
theOperation.ContentAlign = ContentAlign.Top
theOperation.ContentScaleMode =
ContentScaleMode.ShowAll
AddHandler theOperation.ProcessingObject, AddressOf
Processing
theOperation.Import(Server.MapPath("ABCpdf.swf"))
End Using
theDoc.Save(Server.MapPath("swf.pdf"))
theDoc.Clear()
Private Shared Sub Processing(sender As Object, e As
ProcessingObjectEventArgs)
If e.Info.SourceType =
ProcessingSourceType.MultiFrameImage _
AndAlso e.Info.FrameNumber.HasValue
Then
e.Info.FrameNumber = 1 +
CLng(e.Info.FrameRate.Value * 3.5)
End If
End Sub
|
|
|