栅格化PDF无法正确显示 [英] Rastered PDF not displaying correctly

查看:137
本文介绍了栅格化PDF无法正确显示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们拥有PDFRasterizer的许可证,但是在重构代码之后,我们在图像中得到了一个斜线:

We have a license on PDFRasterizer, but after re-factoring the code we get a slash through the image:

要激活密钥,C#代码按照 Stackoverflow中的说明配置许可证文章:

To active the key, the C# code configures the license as described in Stackoverflow article:

const string TALL_COMPONENTS_LICENSE_KEY = "SOMETHING-NOT-TO-BE-SHARED";
TallComponents.Licensing.LicenseCollection.Add("PDFRasterizer.NET 3.0 Client Component Key", TALL_COMPONENTS_LICENSE_KEY);

如何再次正确配置许可证以删除图片中的斜杠?

How do I correctly configure the license again to remove the slash through the picture?

推荐答案

从版本控制中重建后,似乎也必须正确配置AssemblyInfo.cs.

After reconstructing from version control, it seems that the AssemblyInfo.cs must be configured correctly too.

AssemblyProduct必须设置为您的产品名称,如许可证密钥上所示,而AssemblyCompany必须设置为您的公司名称.

The AssemblyProduct must be set to your product name as on the license key and the AssemblyCompany must be set to your company name.

该代码已扩展为:

const string TALL_COMPONENTS_LICENSE_KEY = "SOMETHING";
TallComponents.Licensing.LicenseCollection.Add("PDFRasterizer.NET 3.0 Client Component Key", TALL_COMPONENTS_LICENSE_KEY);

Assembly callingAssembly = Assembly.GetCallingAssembly();
AssemblyProductAttribute product = callingAssembly.GetCustomAttribute<AssemblyProductAttribute>();
AssemblyCompanyAttribute company = callingAssembly.GetCustomAttribute<AssemblyCompanyAttribute>();

if (product.Product != "CONSTANT1")
{
    throw new Exception("The product in the assembly is incorrect.");
}

if (company.Company != "CONSTANT2")
{
    throw new Exception("The company in the assembly is incorrect.");
}

图片不再包含斜杠:

如果您不知道所需的公司或产品名称,则可以登录以获取pdf光栅化器站点,并查看许可证名称. 分配给"后面的文本由公司名称,下划线和装配产品名称的期望值组成.

When you don't know the company or product name expected, you can log on to take pdf rasterizer site and look at the name of the license. The text after 'assigned to' consists of the company name, a separating underscore and the expected value for assembly product name.

经常检查组装产品和公司似乎是明智的做法,因为很容易忘记它们,以便在重新配置软件项目时将其用于许可证检查.如果未明确测试斜杠,则无法直接看到斜杠.这样,许可证配置问题就直接在第一次测试中浮出水面.

It seems wise to always check the assembly product and company, since it so easy to forget that they are used for license checks when reconfiguring your software project. And the slash is not directly visible when not explicitly testing for it. In this way, the license configuration problem surfaces directly on the first test.

这篇关于栅格化PDF无法正确显示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆