Skip to content

Instantly share code, notes, and snippets.

@anotherRedbeard
anotherRedbeard / PDFFromImage.cs
Created July 1, 2020 17:51
How to create a pdf from a streamed image using PDFSharp
using (var ms = new MemoryStream(new WebClient().DownloadData(imageUrl)))
{
PdfDocument doc = new PdfDocument();
doc.Pages.Add(new PdfPage());
XGraphics xgr = XGraphics.FromPdfPage(doc.Pages[0]);
XImage img = XImage.FromStream(ms);
xgr.DrawImage(img, 0, 0);
documentInput = doc;
@anotherRedbeard
anotherRedbeard / placards.js
Created June 30, 2020 15:14
Here are a few example placards in react.js using reactstrap
//custom css for dark themed card
/*how to handle darkCardMode*/
a.darkCard:link {
color: #fff;
}
a.darkCard:hover {
color: lightgray;
text-decoration: none;
}