Hi,
The following code will have an error message after execution. But in linqpad, it can be executed successfully
This hint is a bit strange because the code doesn't need to reference the spire.pdf.dll file
System.IO.FileNotFoundException: Could not load file or assembly 'Spire.Pdf, Version=8.5.0.0, Culture=neutral, PublicKeyToken=663f351905198cb3'. 系统找不到指定的文件。
File name: 'Spire.Pdf, Version=8.5.0.0, Culture=neutral, PublicKeyToken=663f351905198cb3'
at <open "<0x10000005A>|16">line 16 in Script6.cs, Program.Main(String[] args)
In the picture below, there is always a line of code, why?
The following code will have an error message after execution. But in linqpad, it can be executed successfully
This hint is a bit strange because the code doesn't need to reference the spire.pdf.dll file
System.IO.FileNotFoundException: Could not load file or assembly 'Spire.Pdf, Version=8.5.0.0, Culture=neutral, PublicKeyToken=663f351905198cb3'. 系统找不到指定的文件。
File name: 'Spire.Pdf, Version=8.5.0.0, Culture=neutral, PublicKeyToken=663f351905198cb3'
at <open "<0x10000005A>|16">line 16 in Script6.cs, Program.Main(String[] args)
// script ""
/*/ r %dll%\spire\Spire.Doc.dll; /*/
using Spire.Doc;
using Spire.Doc.Documents;
using Spire.Doc.Fields;
class Program {
public static void Main(string[] args) {
if (script.testing) {
args = new[] { @"queries\Spire\SP_多个位置加水印.linq", //代码路径
@"C:\Users\Administrator\Desktop", //args[1] 当前路径
@"日期域.docx", //args[2] 输出文件
};
}
Environment.CurrentDirectory = args[1];
Document document = new Document();
Section section = document.AddSection();
Paragraph paragraph = section.AddParagraph();
paragraph.AppendText("今天的日期为: ");
Field field = paragraph.AppendField("Date", FieldType.FieldData) as Field;
field.Code = @"DATE \@" + "\"yyyy年MM月dd日 \"";
document.SaveToFile(args[2], FileFormat.Docx2013);
}
}
In the picture below, there is always a line of code, why?