Ctype & .ToString 本地化/全球化问题(Questions on localization/globalization of Ctype & .ToString)

问题 我需要回答几个问题以帮助调试我在全球化/本地化方面遇到的问题,这让我相当难堪。 1)如果在全球化/本地化方面将字符串转换为双CType究竟如何工作? 根据我的研究,并询问办公室的其他开发人员,我认为 CType 应该使用您计算机上的任何文化设置。 因此,例如CType("1.23", Double)可以很好地用于美国文化计算机。 但是如果在荷兰的文化计算机上将其转换为123就会搞砸,其中,被识别为小数点和. 被识别为千位分隔符。 但是如果字符串是1,23 ,那么它在荷兰计算机上可以正常工作,而在美国计算机上变为123 。 2)如果我抓取一个数字并说doubleNumber.ToString将其转换为字符串, .ToString如何工作? 根据我在这里的经验,我 99.9% 确定不应该包含千位分隔符,所以像1,234.56这样的数字在美国计算机上会变成1234.56对吗? 和荷兰文化计算机上的数字将成为1234,56因为,是小数位,对不对? 3)在荷兰文化计算机上有没有办法让CType(#, Double)或.ToString在 double 上以某种方式搞砸并开始识别. 作为小数点分隔符而不是,像荷兰文化应该承认吗? 底线:第 3 项是我遇到问题的地方。 我的 99.9% 的美国和外国用户都可以正常运行我的软件,而不会出现任何本地化问题。 但是荷兰的一位用户报告了一个错误

2021-09-23 19:35:12    分类:技术分享    .net   vb.net   localization   globalization   aspose

Questions on localization/globalization of Ctype & .ToString

A few questions I need answered to help debug an issue I'm having with globalization/localization that's leaving me rather stumped. 1) How exactly does CType work if I convert a string into a double when it comes to globalization/localization? From my research, and asking other developers in the office, I think CType should use whatever culture settings you have on your computer. So for example CType("1.23", Double) would work fine for a US culture computer. But it would mess up by converting it to 123 on say a Netherland's culture computer where , is recognized as the decimal point and . is

2021-09-23 11:04:25    分类:问答    .net   vb.net   localization   globalization   aspose

设置嵌套表(aspose nested tables)

问题 为 ASPOSE.Words 做研究。 一切正常,只剩下最后一件事。 问题是如何在表内渲染表? 在嵌套表文档中,示例数据与表示层紧密耦合。 我需要分离数据和表示层。 这里的测试很少: [Test] public void CreateDocumentRecurentalTableInTableTest() { // Structural items are in [], values/data in {} //GIVEN (presentation layer) const string FileName = "_6CreateDocumentRecurentalTableInTableTest.txt"; var doc = new Document(); var builder = new DocumentBuilder(doc); builder.Writeln("TEST -- START"); builder.InsertField(@"MERGEFIELD TableStart:[MyTable] MERGEFORMAT"); builder.InsertField(@"MERGEFIELD [MyTableCol1] \* MERGEFORMAT"); builder.InsertField(@"MERGEFIELD [MyTableCol2] \*

2021-09-12 03:15:19    分类:技术分享    c#   nested   rendering   aspose

Aspose.Word MailMerge set font in paragraph

In FieldMergingCallback.FieldMerging and I set font to all Runs in Node => public void FieldMerging(FieldMergingArgs args) { if (args.FieldValue.ToString().Length > 100) { var node = args.Field.Start.ParentNode.ParentNode; if (node is Shape) { var runlist = node.GetChildNodes(NodeType.Run, true); foreach (Run run in runlist) { run.Font.Size = 6; } } } } But in result pdf is: Why is the font smaller than the third word?

2021-09-08 20:05:22    分类:问答    c#   aspose   aspose.words

Aspose text replacement in PDF doesn't rearrange content

I'm using Aspose to replace a set of words in an existing PDF file via a WPF application. I took a look at this https://docs.aspose.com/display/pdfnet/Replace+Text+in+a+PDF+Document But the section 'Text Replacement should automatically re-arrange Page Contents' didn't help solve my problem which is exactly what is described in the section. "However recently some customers encountered issues during text replace when particular TextFragment is replaced with smaller contents and some extra spaces are displayed in resultant PDF or in case the TextFragment is replaced with some longer string, then

2021-09-08 19:23:08    分类:问答    c#   pdf   aspose

aspose nested tables

Doing research for ASPOSE.Words. Everything works fine just last thing remains. Question is how to render table inside table? In the Nested table documentation sample data is tightly coupled with presentation layer. I need separation of data and presentation layer. So little test here: [Test] public void CreateDocumentRecurentalTableInTableTest() { // Structural items are in [], values/data in {} //GIVEN (presentation layer) const string FileName = "_6CreateDocumentRecurentalTableInTableTest.txt"; var doc = new Document(); var builder = new DocumentBuilder(doc); builder.Writeln("TEST -- START"

2021-09-04 16:45:15    分类:问答    c#   nested   rendering   aspose

x 轴上的自定义标签(custom label on x-axis)

问题 我的图表预测了未来 30 年的价值。 第一个值必须显示为第 1 年。然后是第 5 年、第 10 年...直到 30 年。但在内部,第一年是 0 并且被忽略: 我尝试添加自定义标签,但它只会破坏其他标签: 如果我将它添加到 AxisX2 而不是 AxisX 它什么都不做。 这是制作图表并添加线条的代码: public static Chart MakeChart(string title) { var chart = new Chart(); var area = new ChartArea("GrafiekGebied"); foreach (var axis in area.Axes) { axis.TitleForeColor = defaultColor; axis.LineColor = defaultColor; axis.InterlacedColor = defaultColor; axis.LabelStyle.Font = letterType; axis.LabelAutoFitMinFontSize = (int)letterType.Size; axis.LabelAutoFitMaxFontSize = (int)letterType.Size; axis.MajorGrid.LineColor = defaultColor; axis

2021-07-28 19:55:57    分类:技术分享    c#   charts   ms-word   aspose   asp.net-charts

OpenXML SDK 2.0 vs Aspose for server side word 2007 document generation in .NET

I am going to start a Server side Office automation project in .Net. Below are the key activities that are planned: Create a word document Use a existing word document template having cover page, header, footer, TOC Save file Embed files and resize : HTML, Image, Word, Excel TOC generation and formatting Doc formatting: Page break, Section break, Orientation, Orientation at section break, Continuous page numbering Replace embedded "variables" with use defined contents. I am more inclined towards OpenXML SDK 2.0 since it is free compared to Aspose. Also, in aspose, I could not locate sample

2021-07-12 03:23:17    分类:问答    openxml   openxml-sdk   aspose

在 excel 中生成 excel 和图表的最佳库?(Best library to generate excel and charts in excel?)

问题 哪个是用于从 Asp.net 在 Excel 中导出数据和生成图表的最佳 3rd 方库。 我在 .Net 上进行了研究,发现以下内容: 1. EPPlus:由于我们的工作时间很紧,项目也不会太长,所以如果我们在使用该组件后遇到问题,我们将没有太多时间来解决问题。 由于这是一个开源库,因此无法保证获得帮助以解决问题的时间。 2. Spreadsheetgear2012:这似乎是一个很好的图书馆,它的网站似乎展示了大量的图表示例。 3. Aspose.Cells:这似乎也是一个很好的库,它的站点似乎展示了很好的图表示例,虽然它有点贵,但他们的支持似乎非常好,而且他们似乎对客户的新想法在他们的产品中实施很开放并发布新版本。 我们无法最终决定是否使用Spreadsheetgear2012 for .Net 或Aspose.Cells 。 任何细节和想法将不胜感激。 我在互联网上找到的这些产品的比较已经很老了(大约 4 年前)。 回答1 我们的主要应用是来自电子表格的在线交互和报告,而不是生成和下载其他电子表格文件。 我们尝试了很多电子表格部署选项,最后选择了 Spreadsheetgear。 为此,我们发现它的设置非常简单、快速且灵活。 他们的在线示例和支持也非常好。 我们已经从他们的示例开始,并且能够使用 MVC3 ASP.NET 框架设置他们的 API。 让它工作是一项艰巨的任务

2021-07-11 09:49:11    分类:技术分享    c#   asp.net   excel   aspose   spreadsheetgear

Convert HTML files designed for IE 7, 8 and 9 to PDF using Aspose PDF

I have several thousands of HTML files that are designed for and work only in IE 7, 8 and 9. When I try to convert these to using c# with the code below, they are not properly converted. (i.e. they are converted similar to how it is displayed in IE 11 which is not what's needed). Link to HTML file: https://www.dropbox.com/s/8mzln3jjify4yi0/input.zip?dl=0 If you open the HTML file with the current version of IE and go to Developer Tools within IE and emulate IE 7, 8 or 9, the HTML page is displayed properly. Code: String basePath = "C:\\temp\\"; HtmlLoadOptions htmloptions = new HtmlLoadOptions

2021-07-02 16:41:02    分类:问答    c#   .net   internet-explorer   aspose   aspose.pdf