[英]Reference Web.Config file from another project in same solution C#
[英]How could I get a pdf file generated in a web project, and print it in another project in the same solution c#
我有一個包含多個項目的解決方案,在其中一個項目中,我返回了一個包含要打印數據的PDF文件。 在另一個仍在處理打印部分的相同解決方案中的項目中,我想獲取返回的pdf文件並在此項目中進行打印
我該怎么辦?
在處理打印的項目中,添加對創建pdf的項目的引用:右鍵單擊項目的“參考”>“添加引用”,然后在創建pdf的另一個項目中選擇名稱空間。 現在,始終在您負責打印的項目中,您可以調用其他項目必須公開您剛創建的pdf文件的任何方法。 像這樣:
namespace myProject.printer
{
Public class Print
{
public void PrintFile(myOtherProj.PdfCreator.GetPdf file)
{
// code
}
}
}
您應該考慮通過以下方式制定解決方案:
// This is the method test thati use it for xml, and i want do the same for a pdf
[TestMethod]
public void EvolisPrinterCanPrintMockup()
{
var jobTemplate = new MockupJobTemplate(
() => XElement.Parse(Resources.Carte_ABO_L1_18_19_SMC),
"TEST Print XML");
IPrinter printer = EvolisPrinter.Create(new EvolisPrinterConfiguration
{
Name = TestPrinterName,
Landscape = true
}, new PcScSharpSmartCardService());
var job = printer.CreateJob(jobTemplate);
job.ReadChipUid = true;
var uid = (string)job.Print();
Assert.IsNotNull(uid);
}
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.