using right images

pull/1/head
Sascha Woitschetzki 2021-06-14 11:10:36 +07:00 committed by Sascha Woitschetzki
parent 722196c867
commit 27321dcf9b
4 changed files with 9 additions and 3 deletions

@ -8,6 +8,10 @@ namespace Gremlin.Operations
{
public static void CreatePDF(string fileName, string quotePath)
{
//Copy images to quotePath
File.WriteAllBytes($"{quotePath}\\agilentLogo.png", Properties.Resources.agilentLogo);
File.WriteAllBytes($"{quotePath}\\signWoitschetzki.png", Properties.Resources.signWoitschetzki);
//Create PDF twice
RunningPDFLaTeX(quotePath, fileName, 2);

@ -32,7 +32,7 @@ namespace Gremlin.Operations
_ = texFile.AppendLine($"\\usepackage[left={rand}cm, right={rand}cm, top={rand}cm, bottom={rand}cm]{{geometry}}");
_ = texFile.AppendLine($"\\usepackage[table]{{xcolor}}\r\n\\usepackage[right]{{eurosym}}\r\n\\usepackage[locale=DE]{{siunitx}}\r\n\\usepackage{{scrlayer-scrpage}}\r\n\\usepackage{{lastpage}}\r\n\\usepackage{{graphicx}}\r\n\\usepackage{{multirow}}\r\n\\usepackage{{longtable}}\r\n\\usepackage{{enumitem}}\r\n\\usepackage{{fp, xstring, spreadtab, numprint}}\r\n\\DeclareSIUnit{{\\sieuro}}{{\\mbox{{\\euro}}}}");
_ = texFile.AppendLine($"\\rohead{{{quoteVM.QuotationNumber}}}");
_ = texFile.AppendLine("\\cfoot{Seite \\thepage/\\pageref{LastPage}}\n" + "\\sisetup{round-integer-to-decimal,round-precision=2,round-mode=places}" + "\n\\newcommand{\\produkttitel}[1]{\\textsc{#1}}" + "\n\\renewcommand{\\arraystretch}{1.2}\r\n\\definecolor{AgilentBlau}{HTML}{0085d5}" + "\n\\setlist{noitemsep}\r\n\\begin{document}" + "\n\\begin{tabular}{p{0.4\\hsize}p{0.5\\hsize}}" + "\n\\multirow{4}{*}{\\includegraphics[width=0.9\\hsize]{Agilent_Logo_Tag_h_RGB.png}}" + "\n&\\normalsize{Agilent Technologies Sales \\& Services GmbH \\& Co.KG}\\\\" + "\n&\\normalsize{Life Sciences \\& Chemical Analysis}\\\\" + $"\n&\\normalsize{{Hewlett-Packard-Str. 8}}\\\\" + "\n&\\normalsize{D-76337 Waldbronn}" + "\n\\end{tabular}" + "\n\\par\r\n\\begin{flushright}" + "\n\\colorbox{AgilentBlau}{\\textcolor{white}{\\textsc{\\Huge{Angebot}}}}\r\n\\end{flushright}\r\n\\begin{tabular}{p{0.4\\hsize}p{0.6\\hsize}}" + "\n&\n\\multirow{4}{*}{" + "\n\\begin{tabular}{|ll|}" + "\n\\hline");
_ = texFile.AppendLine("\\cfoot{Seite \\thepage/\\pageref{LastPage}}\n" + "\\sisetup{round-integer-to-decimal,round-precision=2,round-mode=places}" + "\n\\newcommand{\\produkttitel}[1]{\\textsc{#1}}" + "\n\\renewcommand{\\arraystretch}{1.2}\r\n\\definecolor{AgilentBlau}{HTML}{0085d5}" + "\n\\setlist{noitemsep}\r\n\\begin{document}" + "\n\\begin{tabular}{p{0.4\\hsize}p{0.5\\hsize}}" + "\n\\multirow{4}{*}{\\includegraphics[width=0.9\\hsize]{agilentLogo.png}}" + "\n&\\normalsize{Agilent Technologies Sales \\& Services GmbH \\& Co.KG}\\\\" + "\n&\\normalsize{Life Sciences \\& Chemical Analysis}\\\\" + $"\n&\\normalsize{{Hewlett-Packard-Str. 8}}\\\\" + "\n&\\normalsize{D-76337 Waldbronn}" + "\n\\end{tabular}" + "\n\\par\r\n\\begin{flushright}" + "\n\\colorbox{AgilentBlau}{\\textcolor{white}{\\textsc{\\Huge{Angebot}}}}\r\n\\end{flushright}\r\n\\begin{tabular}{p{0.4\\hsize}p{0.6\\hsize}}" + "\n&\n\\multirow{4}{*}{" + "\n\\begin{tabular}{|ll|}" + "\n\\hline");
_ = texFile.AppendLine($"\\textbf{{Angebotsnummer:}}&{quoteVM.QuotationNumber}\\\\");
_ = texFile.Append("Angebotdatum:&\\today\\\\\r\nAngebotsgültigkeit:&60 Tage\\\\");
_ = texFile.AppendLine($"\\textbf{{Ansprechpartner:}}&{RUSettingModel.GetSettingValue(Properties.Settings.Default.userSettingID, "userName")}\\\\");
@ -132,7 +132,7 @@ namespace Gremlin.Operations
_ = anschreibenListe.AppendLine("\\end{itemize}");
}
_ = anschreibenListe.AppendLine($"\\end{{itemize}}\r\n Für Rückfragen und Änderungswünsche stehe ich Ihnen gerne zur Verfügung.\\par \r\n Mit freundlichen Grüßen\\\\\r\n \\includegraphics[width = 5cm]{{sign.png}}\r\n \\vspace{{1cm}}");
_ = anschreibenListe.AppendLine($"\\end{{itemize}}\r\n Für Rückfragen und Änderungswünsche stehe ich Ihnen gerne zur Verfügung.\\par \r\n Mit freundlichen Grüßen\\\\\r\n \\includegraphics[width = 5cm]{{signWoitschetzki.png}}\r\n \\vspace{{1cm}}");
return anschreibenListe;
}

@ -51,6 +51,7 @@
<StackPanel>
<TextBlock x:Name="lblAngebotsname" Text="Angebotsname" TextAlignment="Right" Margin="10,5,10,5"/>
<TextBlock x:Name="lblAngebotsnummer" Text="Angebotsnummer" TextAlignment="Right" Margin="10,5,10,5"/>
<TextBlock x:Name="lblQuotingPath" Text="Angebotspfad" TextAlignment="Right" Margin="10,5,10,5"/>
<TextBlock x:Name="lblGewaehrleistung" Text="Gewährleistung (Monate)" TextAlignment="Right" Margin="10,5,10,5"/>
<TextBlock x:Name="lblAngebotsgueltigkeit" Text="Angebotsgültigkeit (Tage)" TextAlignment="Right" Margin="10,5,10,5"/>
<TextBlock x:Name="lblOppID" Text="SAP Opp ID" TextAlignment="Right" Margin="10,5,10,5"/>
@ -61,6 +62,7 @@
<StackPanel>
<TextBox x:Name="tbAngebotsname" Text="ein Analysegerät" Margin="10,4,10,4" />
<TextBox x:Name="tbQuotationNumber" Text="DE-83PE89-421-6000" Margin="10,4,10,4" />
<TextBox x:Name="tbQuotationPath" Text="D:\Coding\Gremlin\Gremlin\bin\Debug\net5.0-windows" Margin="10,4,10,4" />
<TextBox x:Name="tbGewaehrleistung" Text="12" Margin="10,4,10,4" />
<TextBox x:Name="tbAngebotsgueltigkeit" Text="60" Margin="10,5,10,5" />
<TextBox x:Name="tbOppID" Text="3003541659" Margin="10,4,10,4" />

@ -51,7 +51,7 @@ namespace Gremlin.GremlinUI
private void ButCreateTex_Click(object sender, RoutedEventArgs e)
{
string fileName = $"{quoteVM.QuotationNumber}";
string quotePath = ""; // Properties.Settings.Default.QuotePath;
string quotePath = tbQuotationPath.Text;
TexFileHandler.CreateTexAndOpen(quoteVM, cbBrutto.IsChecked, fileName, quotePath);
PDFHandler.CreatePDF(fileName, quotePath);