【问题标题】:UWP : Links does not work in PDF after generating a PDF with ReportWriter (SyncFusion)UWP:使用 ReportWriter (SyncFusion) 生成 PDF 后,链接在 PDF 中不起作用
【发布时间】:2018-01-01 12:11:49
【问题描述】:

我正在使用 UWP 应用程序从带有 Syncfusion 组件的 .rdlc 模板文件生成 .pdf 文件。我可以从 rdlc 模板文件生成 pdf,但 pdf 中的所有链接(文本或图像)都不起作用。如果我生成 html 文件但不在 pdf 文件中,则链接有效。这是代码:

var pdfFile = await ApplicationData.Current.LocalFolder.CreateFileAsync(String.Concat("Order-", this.Model.SaleReference, ".pdf"), CreationCollisionOption.ReplaceExisting);
using (var stream = await pdfFile.OpenAsync(FileAccessMode.ReadWrite))
{
    using (var outstream = stream.AsStreamForWrite())
    {
        var assembly = typeof(FinalizeViewModel).GetTypeInfo().Assembly;

        var reportStream = assembly.GetManifestResourceStream("UWP.OrderModule.Reports.Test.rdlc");

        var writer = new ReportWriter(reportStream)
        {
            ExportMode = Syncfusion.ReportWriter.ExportMode.Local
        };

        writer.Save(outstream, WriterFormat.PDF);

        outstream.Dispose();
    }
}

await Windows.System.Launcher.LaunchFileAsync(pdfFile);

我也尝试使用此代码,但结果相同:

var file = await ApplicationData.Current.LocalFolder.CreateFileAsync(String.Concat("Order-", this.Model.SaleReference, ".pdf"), CreationCollisionOption.ReplaceExisting);

using (var stream = await WindowsRuntimeStorageExtensions.OpenStreamForWriteAsync(file))
{
    var assembly = typeof(FinalizeViewModel).GetTypeInfo().Assembly;

    var reportStream = assembly.GetManifestResourceStream("UWP.OrderModule.Reports.Test.rdlc");

    var writer = new ReportWriter(reportStream)
    {
        ReportProcessingMode = Syncfusion.ReportWriter.ProcessingMode.Local,
        ExportMode = Syncfusion.ReportWriter.ExportMode.Local
    };

    writer.Save(stream, WriterFormat.PDF);
}

await Windows.System.Launcher.LaunchFileAsync(pdfFile);

怎么了? ReportWriter 类(Syncfusion.RdllO.RdllOExportEngine 类)是否有问题? 感谢您的帮助。

【问题讨论】:

    标签: pdf uwp syncfusion


    【解决方案1】:

    目前 Syncfusion ReportWriter 不支持将报告导出为带有超链接选项的 PDF。我们将考虑将此功能包含在我们即将发布的任何版本中。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-12-30
      • 2019-04-18
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多