WinRT で画像のリストから PDF ファイルを作成する方法。ここでWindows Phone 8に似たものを見つけました(「Windows Phone 8で画像のリストをpdfに変換する」)が、Windows 8の解決策を探しています。
3199 次
4 に答える
1
http://jspdf.com/ を試してください
これは WinJS で動作するはずですが、テストしていません。XAML アプリでは、jsPDF 対応ページを使用して Web ブラウザー コントロールをホストすることができます。
于 2013-03-26T18:57:19.043 に答える
0
ComponentOneは、Windows Phone に含まれていたのと同じ PDF ライブラリを Windows ランタイム用にリリースしました。もちろん、オープンソースではありません。
于 2013-03-26T18:16:43.187 に答える
0
このタスクには、 Amyuni PDF Creator for WinRT (商用ライブラリ) を使用できます。クラスの新しいインスタンスを作成して新しい PDF ファイルを作成し、メソッドAddPageAmyuniPDFCreator.IacDocument
で新しいページを追加し、メソッドIacPage.CreateObjectを使用して各ページに画像を追加できます。
ページに画像を追加するための C# のコードは、次のようになります。
public IacDocument CreatePDFFromImage()
{
IacDocument pdfDoc = new IacDocument();
// Set the license key
pdfDoc.SetLicenseKey("Amyuni Tech.", "07EFCD0...C4FB9CFD");
IacPage targetPage = pdfDoc.GetPage(1); // A new document will always be created with an empty page
// Adding a picture to the current page
using (Stream imgStrm = await Windows.ApplicationModel.Package.Current.InstalledLocation.OpenStreamForReadAsync("pdfcreatorwinrt.png"))
{
IacObject oPic = page.CreateObject(IacObjectType.acObjectTypePicture, "MyPngPicture");
BinaryReader binReader = new BinaryReader(imgStrm);
byte[] imgData = binReader.ReadBytes((int)imgStrm.Length);
// The "ImageFileData" attribute has not been added yet to the online documentation
oPic.AttributeByName("ImageFileData").Value = imgData;
oPic.Coordinates = new Rect(100, 2000, 1200, 2000);
}
return pdfDoc;
}
免責事項: 私は現在、ライブラリの開発者として働いています
「オープン ソース」の代替手段として、利用可能な多くのオープン ソース ライブラリの 1 つを使用して PDF ファイルを作成する Web サービスに依存する方がよい場合があります。
于 2013-04-03T18:03:17.957 に答える