flayms / markdown2pdf Goto Github PK
View Code? Open in Web Editor NEW.NET library for converting markdown to PDF.
Home Page: https://www.nuget.org/packages/Markdown2Pdf/
License: MIT License
.NET library for converting markdown to PDF.
Home Page: https://www.nuget.org/packages/Markdown2Pdf/
License: MIT License
Example:
[TOC]
### h3 Heading
##### h5 Heading
produces
i. h3 Heading
a. a. h5 Heading
instead of
i. h3 Heading
a. h5 Heading
After update from v 1.3.0 to 2.0.0 I get this error.
System.ComponentModel.Win32Exception
HResult=0x80004005
Nachricht = An error occurred trying to start process 'C:\...\bin\Debug\net6.0-windows\Chrome\Win64-123.0.6312.86\chrome-win64\chrome.exe' with working directory 'C:\...I\bin\Debug\net6.0-windows'. Das System kann die angegebene Datei nicht finden.
Quelle = System.Diagnostics.Process
Stapelüberwachung:
bei System.Diagnostics.Process.StartWithCreateProcess(ProcessStartInfo startInfo)
bei System.Diagnostics.Process.Start()
bei PuppeteerSharp.States.ProcessStartingState.<StartCoreAsync>d__6.MoveNext()
bei PuppeteerSharp.Launcher.<LaunchAsync>d__8.MoveNext()
bei PuppeteerSharp.Launcher.<LaunchAsync>d__8.MoveNext()
bei Markdown2Pdf.Markdown2PdfConverter.<_CreateBrowserAsync>d__50.MoveNext()
bei Markdown2Pdf.Markdown2PdfConverter.<_GeneratePdfAsync>d__47.MoveNext()
bei Markdown2Pdf.Markdown2PdfConverter.<_ConvertInternal>d__44.MoveNext()
bei Markdown2Pdf.Markdown2PdfConverter.<_Convert>d__43.MoveNext()
bei Markdown2Pdf.Markdown2PdfConverter.<Convert>d__40.MoveNext()
bei Markdown2Pdf.Markdown2PdfConverter.<Convert>d__39.MoveNext()
bei inoPBI.FrmPDF.VB$StateMachine_90_CmdDocumentation_Click.MoveNext() in C:\...\FrmPDF.vb: Zeile64
Line 64 is Dim strPDF = Await mdconvert.Convert(TxtFileDocu.Text)
I get the same error running the unit tests on branch main and develop
System.ComponentModel.Win32Exception : An error occurred trying to start process 'C:\...\Markdown2Pdf\Markdown2Pdf.Tests\bin\Debug\net8.0\Chrome\Win64-123.0.6312.86\chrome-win64\chrome.exe' with working directory 'C:\...\Markdown2Pdf\Markdown2Pdf.Tests\bin\Debug\net8.0'. Das System kann die angegebene Datei nicht finden.
Process.StartWithCreateProcess(ProcessStartInfo startInfo)
ProcessStartingState.StartCoreAsync(LauncherBase p) Zeile 68
Launcher.LaunchAsync(LaunchOptions options) Zeile 66
Launcher.LaunchAsync(LaunchOptions options) Zeile 99
Markdown2PdfConverter._CreateBrowserAsync() Zeile 314
Markdown2PdfConverter._GeneratePdfAsync(String htmlFilePath, String outputFilePath) Zeile 217
Markdown2PdfConverter._ConvertInternal(String outputFilePath, String markdownContent, String markdownFilePath) Zeile 176
Markdown2PdfConverter._Convert(String outputFilePath, String markdownContent, String markdownFilePath) Zeile 158
Markdown2PdfConverter.Convert(String markdownFilePath, String outputFilePath) Zeile 120
Markdown2PdfConverter.Convert(String markdownFilePath) Zeile 103
HtmlTests.TestGeneralFunctionality() Zeile 20
GenericAdapter`1.GetResult()
AsyncToSyncAdapter.Await(Func`1 invoke)
TestMethodCommand.RunTestMethod(TestExecutionContext context)
TestMethodCommand.Execute(TestExecutionContext context)
<>c__DisplayClass1_0.<Execute>b__0()
DelegatingTestCommand.RunTestMethodInThreadAbortSafeZone(TestExecutionContext context, Action action)
running with Microsoft Visual Studio Community 2022 (64-Bit) - Current Version 17.9.5
Currently the numbers in TOC are formatted like this:
Level 1 number
Level 2 small roman numbers
Level 3 - 6 small letters
Adjust formatting to have individual number formatting for each level
Adjust formatting to the following:
Level 1
Level 1.1
Level 1.1.1
Are you sure that a new branch should be base on then develop branch.
For me this will lead to inconstitings branches.
Add a placeholder for manual page break so a manual page break can be added for the pdf output instead of using
<div style="page-break-after: always"></div>
in markdown document.
Automatically add the
<style>
html {
-webkit-print-color-adjust: exact;
}
#header, #footer {
padding: 0;
}
</style>
to the header / footer.
Is there a chance easily add two or more markdown files to one output file. E.g. you have three chapter files which should result in one filal output file.
Style: https://jekyllrb.com/docs/front-matter/
Alternative: Wrap YAML in Comment-Block
If I had header as
#Первый заголовок
in TOC this header becomes unclickable, and page tracking is lost
Create separate TOC options class:
If only h2-h6 headers set MinDepth to h2 by default.
Hi
I have some problems converting from .md -> .pdf when I run my Blazor server in a docker containers.
CODE SNIPPET:
// get markdown file reference
string file = ReleaseFileFullPath;
// check file existence
if (!File.Exists(file))
{
throw new FileNotFoundException($"Could not find file: '{file}'");
}
// convert markdown file to pdf
string tmpPdfFile = Path.GetTempFileName();
var options = new Markdown2PdfOptions()
{
MarginOptions = new MarginOptions()
{
Top = "2cm",
Bottom = "2cm",
Left = "2cm",
Right = "2cm"
}
};
Markdown2PdfConverter converter = new Markdown2PdfConverter(options);
await Task.Run(() => converter.Convert(file, tmpPdfFile)).ConfigureAwait(false);
The files are evaluated to this:
file: /app/ReleaseInfo.md
tmpPdfFile : /tmp/tmpXiokNg.tmp
The source .md file EXISTS and the dest .tmp file is created but size is empty and the convert method fails. Any clues on what is wrong?
If I add img tag in HeaderHtml, for example:
HeaderHtml = "<img src=\"test.png\" alt =\"Text\"/>"
Or
HeaderHtml = "<img src=\"https://mobile.photoprocenter.ru/files/4552_0.jpg\" alt =\"Text\"/>"
The image is not displayed, no matter what path I specify.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.