'2020/10/22'에 해당되는 글 6건

  1. 2020.10.22 markdig custom markdown
  2. 2020.10.22 pdfsharp , migradoc
  3. 2020.10.22 itext7
  4. 2020.10.22 c# pdf itextsharp -> itext7
  5. 2020.10.22 xournal++ 는 반드시 PPA로 설치하자?
  6. 2020.10.22 아아 SD가 죽었습니다 ㅠㅠ
Programming/c# & winform2020. 10. 22. 18:24

돌려는 봤는데 어렵네 ㅠㅠ

어떻게 파서를 짜야하려나?

 

[링크 : https://www.cyotek.com/blog/writing-custom-markdig-extensions]

  [링크 : https://www.cyotek.com/downloads/view/MarkdigMantisLink.zip/]

 

[링크 : https://odetocode.com/blogs/scott/archive/2020/01/23/a-custom-renderer-extension-for-markdig.aspx]

 

+ 2020.10.29

원래 구현하고자 하는 것은

[ ]

[x]

을 받으면 HTML의 input type=checkbox 로 변환하는 건데

MantisLink 예제를 따라해보니 [는 걸려지지 않는다.

아무래도 링크로 연관되어 [는 이미 처리되어버리기 때문에 걸러내질 못하는 듯..

 

그러면 github 등에서 어떻게 구현을 해서 쓰고 있는걸까?

'Programming > c# & winform' 카테고리의 다른 글

자식에서 부모창의 자원 접근하기  (0) 2020.10.23
c# winform 자식 다이얼로그에서 F4 막기  (0) 2020.10.23
pdfsharp , migradoc  (0) 2020.10.22
itext7  (0) 2020.10.22
c# pdf itextsharp -> itext7  (0) 2020.10.22
Posted by 구차니
Programming/c# & winform2020. 10. 22. 18:04

MIT license

[링크 : http://www.pdfsharp.net/Licensing.ashx]

 

 

다만 html 을 pdf로 변환하는 기능은 없다고 -_ㅠ

Can I use PDFsharp to convert HTML or RTF to PDF?¶
No, not "out of the box", and we do not plan to write such a converter in the near future.

Yes, PDFsharp with some extra code can do it. But we do not supply that extra code.
On NuGet and other sources you can find a third party library "HTML Renderer for PDF using PdfSharp" that converts HTML to PDF. And there may be other libraries for the same or similar purposes, too. Maybe they work for you, maybe they get you started.

[링크 : https://stackoverflow.com/questions/48759671/convert-html-string-to-pdf-with-migradoc]

 

+

HtmlRenderer.RdfSharp 라는게 가장 위에 나오는데

BSD 3 clause 라이센스..

[링크 : https://archive.codeplex.com/?p=htmlrenderer]

[링크 : https://github.com/ArthurHub/HTML-Renderer]

'Programming > c# & winform' 카테고리의 다른 글

c# winform 자식 다이얼로그에서 F4 막기  (0) 2020.10.23
markdig custom markdown  (0) 2020.10.22
itext7  (0) 2020.10.22
c# pdf itextsharp -> itext7  (0) 2020.10.22
c# print 하기  (0) 2020.10.19
Posted by 구차니
Programming/c# & winform2020. 10. 22. 16:51

HtmlConverter.ConvertToPdf()

는 하나의 HTML을 pdf로 변환하고 close 하기 때문에

merger를 이용해서 합쳐야 하는 듯 하고

 

HtmlConverter.ConvertToDocument()

는 pdf로 변환하지만 ConvertToPdf()와는 다르게 div()를 정상적으로 처리하지 못한다.

 

[링크 : https://kb.itextpdf.com/home/it7kb/ebooks/itext-7-converting-html-to-pdf-with-pdfhtml/chapter-7-frequently-asked-questions-about-pdfhtml/how-to-parse-multiple-html-files-into-one-pdf] java

 

private void button2_Click(object sender, EventArgs e)
        {
            String DEST = "hello_world.pdf";

            FileInfo file = new FileInfo(DEST);
            file.Directory.Create();

            PdfWriter writer = new PdfWriter(DEST);
            PdfDocument pdf = new PdfDocument(writer);
            Document document = new Document(pdf, PageSize.A4.Rotate());
            document.SetMargins(20, 20, 20, 20);
            PdfMerger pdfMerger = new PdfMerger(pdf);

            document.Add(new Paragraph("Hello World!"));

            String[] SRC = {
            @"d:\test1.html",
            @"d:\test2.html",
            @"d:\test3.html",
            @"d:\test4.html" };

            foreach (var html in SRC)
            {
                MemoryStream baos = new MemoryStream();
                PdfDocument temp = new PdfDocument(new PdfWriter(baos));
                temp.SetDefaultPageSize(PageSize.A4.Rotate());
                HtmlConverter.ConvertToPdf(System.IO.File.ReadAllText(html), temp, new ConverterProperties());
                ReaderProperties rp = new ReaderProperties();
                baos = new MemoryStream(baos.ToArray());
                temp = new PdfDocument(new PdfReader(baos, rp));
                pdfMerger.Merge(temp, 1, temp.GetNumberOfPages());
                temp.Close();
            }
            pdfMerger.Close();            
        }

[링크 : https://stackoverflow.com/questions/57415902/generate-one-pdf-document-with-multiple-pages-converting-from-html-using-itext-7] .net

 

pdf 특성상 붙이는 파일의 용지 방향을 지정해 주어야 한다.

[링크 : https://stackoverflow.com/questions/54347293/how-to-set-orientation-to-landscape-in-itext-7]

'Programming > c# & winform' 카테고리의 다른 글

markdig custom markdown  (0) 2020.10.22
pdfsharp , migradoc  (0) 2020.10.22
c# pdf itextsharp -> itext7  (0) 2020.10.22
c# print 하기  (0) 2020.10.19
c# printer 사용하기 - printer enumeration  (0) 2020.10.19
Posted by 구차니
Programming/c# & winform2020. 10. 22. 15:10

iTextSharp

pdf 파일에 직접 내용을 만들어 넣기(Paragraph 등으로)

[링크 : http://www.csharpstudy.com/Practical/Prac-pdf.aspx]

[링크 : https://stackoverflow.com/questions/11307749/creating-multiple-page-pdf-using-itextsharp]

  [링크 : https://www.nuget.org/packages/iTextSharp/]

 

iTextSharp에 HTML 내용을 넣기

[링크 : https://jujun.tistory.com/118]

 

iTextSharp

Docuement.NewPage()

한페이지 추가하기

[링크 : https://stackoverflow.com/questions/4124106/add-a-page-to-pdf-document-using-itextsharp]

 

 

        private void button2_Click(object sender, EventArgs e)
        {

            Document doc = new Document(iTextSharp.text.PageSize.A4);
            PdfWriter wr = PdfWriter.GetInstance(doc, new FileStream("simple.pdf", FileMode.Create));

            doc.Open();

            doc.AddTitle("Simple PDF 생성 예제");
            doc.AddAuthor("Alex");
            doc.AddCreationDate();

            // 영문쓰기
            doc.Add(new Paragraph("English : How are you?"));
            doc.Add(new Paragraph("국문: 어때요?"));

            doc.NewPage();

            StyleSheet styles = new StyleSheet();
            HtmlWorker hw = new HtmlWorker(doc);

            String html_data = System.IO.File.ReadAllText(@"d:\test.html");
            hw.Parse(new StringReader(html_data));

            doc.NewPage();

            String html_data2 = System.IO.File.ReadAllText(@"d:\test2.html");
            hw.Parse(new StringReader(html_data2));

            hw.EndDocument();
            hw.Close();

            doc.Close();
        }

---

 

 

using iText.Kernel.Pdf;
using iText.Layout;
using iText.Layout.Element;

using iText.Html2pdf;
using iText.Html2pdf.Attach.Impl;
using iText.Layout.Font;

        private void button2_Click(object sender, EventArgs e)
        {
            String DEST = "hello_world.pdf";

            FileInfo file = new FileInfo(DEST);
            file.Directory.Create();

            PdfWriter writer = new PdfWriter(DEST);
            PdfDocument pdf = new PdfDocument(writer);
            Document document = new Document(pdf);
            document.Add(new Paragraph("Hello World!"));

            HtmlConverter.ConvertToPdf(new FileStream(@"d:\test2.html", FileMode.Open), pdf);
            document.Close();
        }

[링크 : https://kb.itextpdf.com/home/it7kb/examples/pdfhtml-accessible-pdf-creation]

 

[링크 : https://github.com/itext/itextsharp]

[링크 : https://github.com/itext/itext7-dotnet]

 

+

document.Add(new AreaBreak());

[링크 : https://stackoverflow.com/questions/17198337/how-can-i-make-a-page-break-using-itext]

[링크 : https://www.tutorialspoint.com/itext/itext_adding_areabreak.htm]

 

 

+

ConverToPdf() 메소드는 호출 이후 document를 close() 해버린다고.. -_-

The convertToPdf()/ConvertToPdf() methods create a complete PDF file. Any File, FileInfo, OutputStream, PdfWriter (Java/.NET), or PdfDocument (Java/.NET) that is passed to the convertToPdf()/ConvertToPdf() method is closed once the input is parsed and converted to PDF. This might not always be what you want.

In some cases, you want to add some extra information to the Document(Java/.NET), or maybe you don't want to convert the HTML to a PDF file, but to a series of iText objects you can use for a different purpose. That's what the convertToDocument()/ConvertToDocument() and convertToElements()/ConvertToElements() methods are about.

In the C01E07_HelloWorld.java example, we convert our Hello World HTML to a Document (Java/.NET) because we want to add some extra content after we've done parsing the HTML:

[링크 : https://kb.itextpdf.com/.../itext-7-converting-html-to-pdf-with-pdfhtml/chapter-1-hello-html-to-pdf]

'Programming > c# & winform' 카테고리의 다른 글

pdfsharp , migradoc  (0) 2020.10.22
itext7  (0) 2020.10.22
c# print 하기  (0) 2020.10.19
c# printer 사용하기 - printer enumeration  (0) 2020.10.19
c# dialog dual screen  (0) 2020.10.15
Posted by 구차니
프로그램 사용/xournal2020. 10. 22. 13:56

ubuntu 18.04를 쓰는데

우분투에서 관리하는 xournal++은 프린트가 안되는 문제가 있다.

Version 1.0.16버전에서는 프린트시 파일로 저장하기 밖에 안뜨는데

PPA로 설치하니 1.1.0+dev 버전으로 설치되고 프린트에 정상적으로 목록이 출력된다.

 

[링크 : https://xournalpp.github.io/installation/]

 

짧은 영어로 올린다고 힘들었는데 너무 싱겁게 해결!

[링크 : https://github.com/xournalpp/xournalpp/issues/2329]

'프로그램 사용 > xournal' 카테고리의 다른 글

xournal++  (0) 2020.09.16
xournal 획 삭제 기본값으로 설정하기  (0) 2019.06.03
Posted by 구차니
개소리 왈왈/컴퓨터2020. 10. 22. 10:18

어제 odroid xu4 밑면 닦아주니 노이즈가 덜해져서

위아래로 PCB 세척제를 써서 닦아주면 잘되겠지? 하고 회사 가져왔는데

출근하면서 자다가 눌렸나 금이 쫙! ㅠㅠ

부팅이 안되서 다른거 닦다가 망가트렸나 싶어서 SD 리더에 읽어보니 응답없음.. ㅠㅠ

 

잘가 ㅠㅠ 고생했어 ㅠㅠ

 

 

1년에 하나 부숴먹는건가!

2020/05/19 - [개소리 왈왈/사진과 수다] - sd 카드는 부서지는 거구나 ㅠㅠ

Posted by 구차니