Created the first version of HTML code for the front form. Changed to the Pechkin HTML to PDF library. Removed the string tester. Fixed a bug with the main form where the APC tables would not be sorted by row position.
This commit is contained in:
@@ -3,8 +3,8 @@ using System.Data;
|
||||
using System.Windows.Forms;
|
||||
using System.IO;
|
||||
using System.Drawing.Imaging;
|
||||
using System.Linq;
|
||||
using System.Web.UI;
|
||||
using TheArtOfDev.HtmlRenderer.WinForms;
|
||||
|
||||
namespace AdvertsingProfitControl
|
||||
{
|
||||
@@ -22,9 +22,9 @@ namespace AdvertsingProfitControl
|
||||
|
||||
try
|
||||
{
|
||||
var imageFromHtml = HtmlRender.RenderToImage(code);
|
||||
imageFromHtml.Save(Application.StartupPath + "\\BackPage.png", ImageFormat.Png);
|
||||
imageFromHtml.Dispose();
|
||||
//var imageFromHtml = HtmlRender.RenderToImage(code);
|
||||
//imageFromHtml.Save(Application.StartupPath + "\\BackPage.png", ImageFormat.Png);
|
||||
//imageFromHtml.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
@@ -36,7 +36,28 @@ namespace AdvertsingProfitControl
|
||||
}
|
||||
}
|
||||
|
||||
public void GenerateWeeklyInventoryControlPage(int dateId)
|
||||
public void RenderHtmlCodeToImage(string path, string targetPath)
|
||||
{
|
||||
var htmlCode = File.ReadAllLines(path);
|
||||
var code = htmlCode.Aggregate("", (current, line) => current + "\r\n" + line);
|
||||
|
||||
try
|
||||
{
|
||||
//var imageFromHtml = HtmlRender.RenderToImage(code);
|
||||
//imageFromHtml.Save(targetPath, ImageFormat.Png);
|
||||
//imageFromHtml.Dispose();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_console.WriteToLog(FrmLogConsole.Level.Critical,
|
||||
"Failed to generate an updated image for the back page of Advertising Profit Control.");
|
||||
_console.WriteToLog(FrmLogConsole.Level.Debug, e.Message);
|
||||
_console.WriteToLog(FrmLogConsole.Level.Info, "This is most likely a screw you from the GDI+ subsystem of Windows.");
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
public void GenerateWeeklyInventoryControlPage(int dateId)
|
||||
{
|
||||
//var databaseTracker = new DatabaseTracker();
|
||||
//var databaseReader = new DatabaseReader();
|
||||
|
||||
Reference in New Issue
Block a user