Free Library For Create PDF in UWP

  • (2 Pages)
  • +
  • 1
  • 2

20 Replies - 1306 Views - Last Post: 27 June 2019 - 08:10 AM Rate Topic: -----

#1 tokei   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 15-December 11

Free Library For Create PDF in UWP

Posted 20 June 2019 - 07:06 PM

Hi community,

I would like to ask , is it any free library for create PDF in UWP ,. also can debug using ARM platform ?
I have google but without success.

If you know, can you share with me ?

Thank you.

From,
tokei
Is This A Good Question/Topic? 0
  • +

Replies To: Free Library For Create PDF in UWP

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,152
  • Joined: 12-June 08

Re: Free Library For Create PDF in UWP

Posted 20 June 2019 - 07:41 PM

Nreco works well for me.

https://www.nrecosit...or_net.aspx#faq
Was This Post Helpful? 0
  • +
  • -

#3 tokei   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 15-December 11

Re: Free Library For Create PDF in UWP

Posted 20 June 2019 - 08:49 PM

Thank you for sharing.

However I am not involved with HTML. Is it works well too ?

This post has been edited by Skydiver: 21 June 2019 - 05:34 AM
Reason for edit:: Removed unnecessary quote. No need to quote the post above yours.

Was This Post Helpful? 0
  • +
  • -

#4 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7053
  • View blog
  • Posts: 23,973
  • Joined: 05-May 12

Re: Free Library For Create PDF in UWP

Posted 21 June 2019 - 05:35 AM

There is no need to quote the post above yours. Just use the big Reply button or the Fast Reply area.

A long time ago, I used iTextSharp. You can use the current incarnation iText 7.
Was This Post Helpful? 0
  • +
  • -

#5 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,152
  • Joined: 12-June 08

Re: Free Library For Create PDF in UWP

Posted 21 June 2019 - 06:53 AM

I don't understand the question.
Was This Post Helpful? 0
  • +
  • -

#6 h4nnib4l   User is offline

  • The Noid
  • member icon

Reputation: 1434
  • View blog
  • Posts: 2,035
  • Joined: 24-August 11

Re: Free Library For Create PDF in UWP

Posted 21 June 2019 - 09:24 AM

View PostSkydiver, on 21 June 2019 - 06:35 AM, said:

A long time ago, I used iTextSharp. You can use the current incarnation iText 7.


If you're using it for a closed-source project, you'll have to use v4.1.6 - that's the last version that was on MPL/LGPL before they moved to AGPL.
Was This Post Helpful? 1
  • +
  • -

#7 tokei   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 15-December 11

Re: Free Library For Create PDF in UWP

Posted 21 June 2019 - 02:01 PM

I have try iTextSharp. However it is does not support for UWP .

Quote

I don't understand the question.


I have create IoT application using UWP platform. But I need a free library to process to convert text file to PDF format.

I have try iTextSharp but it does not compatible with UWP platform.

This post has been edited by tokei: 21 June 2019 - 01:57 PM

Was This Post Helpful? 0
  • +
  • -

#8 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 15262
  • View blog
  • Posts: 61,152
  • Joined: 12-June 08

Re: Free Library For Create PDF in UWP

Posted 21 June 2019 - 02:03 PM

*shrug* I don't see why the NReco won't work. So you append a few basic HTML tags, and cap them on the string from a textfile. Okay.. so that all feeds in and you get a PDF on the back end. Voila!
Was This Post Helpful? 0
  • +
  • -

#9 tokei   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 15-December 11

Re: Free Library For Create PDF in UWP

Posted 21 June 2019 - 07:00 PM

Ok modi123,

I thought when I see that library convert from HTML to PDF, I am imagine I must create HTML file.
So when you say just append the HTML code to the back end code, so maybe I can try it and see how the result.''

Thanks
Was This Post Helpful? 0
  • +
  • -

#10 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7053
  • View blog
  • Posts: 23,973
  • Joined: 05-May 12

Re: Free Library For Create PDF in UWP

Posted 22 June 2019 - 06:54 PM

HTML doesn't even require HTML tags until you start specifying your document type by using the <DOCTYPE> tag. So if all you have is plain text then if Nreco is HTML compliant, it should just work. It'll just look like one big long string of text. Recall what a majority of the web pages looked like before Geocities. :)

Of course, it's very likely that you will want to have headers, paragraphs, etc. Then you'll have to start sticking in HTML tags into your text so that it formats properly within the PDF. HTML is easy, though. This is why it gained acceptance so quickly.
Was This Post Helpful? 0
  • +
  • -

#11 tokei   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 15-December 11

Re: Free Library For Create PDF in UWP

Posted 23 June 2019 - 07:35 PM

I got the error ,

Could not load type 'System.Web.HttpContext'

I have check the assembly ,no HTML web in UWP.

Need your help. Thanks
Was This Post Helpful? 0
  • +
  • -

#12 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7053
  • View blog
  • Posts: 23,973
  • Joined: 05-May 12

Re: Free Library For Create PDF in UWP

Posted 23 June 2019 - 08:04 PM

Without seeing your code, it is kind of hard to help you.
Was This Post Helpful? 0
  • +
  • -

#13 tokei   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 15-December 11

Re: Free Library For Create PDF in UWP

Posted 23 June 2019 - 08:42 PM

Below is the code :

using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;

public sealed partial class MainPage : Page
{
	private void Button_Click(object sender, RoutedEventArgs e)
	{
		string v = "<p>Hello world</p>";

// Error : Could not load type 'System.Web.HttpContext' from assembly 'System.Web
		var pdfBytes = (new NReco.PdfGenerator.HtmlToPdfConverter()).GeneratePdf(v);
		System.IO.File.WriteAllBytes("aabbcc.pdf", pdfBytes);
	}
}

This post has been edited by tokei: 23 June 2019 - 08:43 PM

Was This Post Helpful? 0
  • +
  • -

#14 Skydiver   User is offline

  • Code herder
  • member icon

Reputation: 7053
  • View blog
  • Posts: 23,973
  • Joined: 05-May 12

Re: Free Library For Create PDF in UWP

Posted 23 June 2019 - 09:03 PM

before you invest more time in this, see FAQ question #3 in the link from post #2. Apparently, UWP is not supported by Nreco.
Was This Post Helpful? 0
  • +
  • -

#15 tokei   User is offline

  • D.I.C Head

Reputation: 1
  • View blog
  • Posts: 93
  • Joined: 15-December 11

Re: Free Library For Create PDF in UWP

Posted 23 June 2019 - 09:07 PM

Ok. so sad it is not support by UWP :(
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2