不知道 怎么 才能 把 pdf 转换成 多个 swf ,还有就是 不能 读取 单个 的swf 。
比如 pdf 的 总页数 是 38 1_10.swf 1_5.swf 11_10.swf 11_5.swf 16_10.swf 16_5.swf 21_10.swf 21_5.swf 26_10.swf
26_5.swf 31_5.swf 31_8.swf 36_3.swf 6_10.swf 6_5.swf
比如 pdf 的 总页数 是 38 1_10.swf 1_5.swf 11_10.swf 11_5.swf 16_10.swf 16_5.swf 21_10.swf 21_5.swf 26_10.swf
26_5.swf 31_5.swf 31_8.swf 36_3.swf 6_10.swf 6_5.swf
{
var _loc_11:ByteArray = null;
var _loc_12:int = 0;
trace("binaryLoadComplete...");
if (this._noDoc)
{
if (this._noDoc.parent)
{
this._noDoc.parent.removeChild(this._noDoc);
}
this._noDoc = null;
}
this._loadPercent = 0;
var _loc_2:* = URLLoader(event.target);
var _loc_3:* = _loc_2.data;
this._byteArray = [];
var _loc_4:Array = [];
var _loc_5:int = 0;
var _loc_6:* = _loc_3.length;
while (_loc_5 < _loc_6)
{
if (_loc_5 + 3 < _loc_6)
{
if ((_loc_3[_loc_5] == 67 || _loc_3[_loc_5] == 70) && _loc_3[(_loc_5 + 1)] == 87 && _loc_3[_loc_5 + 2] == 83 && (_loc_3[_loc_5 + 3] == 9 || _loc_3[_loc_5 + 3] == 10))
{
_loc_4.push(_loc_5);
}
}
else
{
_loc_4.push(_loc_6);
break;
}
_loc_5++;
}
var _loc_7:* = _loc_3.readMultiByte(_loc_4[0], "utf-8");
trace(_loc_7);
var _loc_8:* = JSON.decode(_loc_7);
this._pagesAll = Number(_loc_8["totalPage"]);
if (!this._pagesLoaded)
{
this._pagesLoaded = 0;
}
this._pagesLoaded = this._pagesLoaded + (Number(_loc_8["toPage"]) - Number(_loc_8["fromPage"]) + 1);
this._fromPage = Number(_loc_8["fromPage"]);
this._toPage = Number(_loc_8["toPage"]);
trace("pagesall:" + this._pagesAll + " , frompage:" + this._fromPage + " , topage:" + this._toPage);
this._pagethLoading = Number(_loc_8["fromPage"]) - 1;
var _loc_9:int = 0;
var _loc_10:* = _loc_4.length - 1;
while (_loc_9 < _loc_10)
{
_loc_11 = new ByteArray();
_loc_12 = _loc_4[(_loc_9 + 1)] - _loc_4[_loc_9];
_loc_3.readBytes(_loc_11, 0, _loc_12);
this._byteArray.push(_loc_11);
_loc_9++;
}
trace("...............这一次加载了多少 页:" + this._byteArray.length);
this._hasConvertPages = 0;
this._allConvertPages = Math.min(this._byteArray.length, this._toPage - this._fromPage + 1);
if (this._allConvertPages > 0)
{
this.byteArr2DisplayObj(this._hasConvertPages);
}
else
{
trace("blank document ...");
this.processNoDoc();
this._loadPercent = 0;
dispatchEvent(new Event("STOP_LOADING", true));
this._inLoading = false;
}
return;
}// end function 哪位 哥哥,看懂了 告诉啊。
public void ConvertPdfToSwf(string inFilename, string swfFilename)
{
System.Diagnostics.Process process = new System.Diagnostics.Process();
try
{
string flashPrinter = string.Concat(AppDomain.CurrentDomain.BaseDirectory, @"systemInfo\FlashPaper2\FlashPrinter.exe");
System.Diagnostics.ProcessStartInfo startInfo = new System.Diagnostics.ProcessStartInfo(flashPrinter);
startInfo.Arguments = string.Concat(Server.MapPath(inFilename), " -o ", Server.MapPath(swfFilename));
process.StartInfo = startInfo;
process.StartInfo.CreateNoWindow = false;
process.StartInfo.UseShellExecute = false;
process.StartInfo.RedirectStandardError = true;
process.StartInfo.RedirectStandardInput = false;
process.StartInfo.RedirectStandardOutput = false;
process.Start();
}
catch (Exception ex)
{
throw ex;
}
finally
{
process.WaitForExit();
process.Close();
process.Dispose();
}
}下载一个FlashPaper 安装到程序目录里面