We are able to make pdf/a-3 files. We are also able to convert html files to pdf.
But we are not able to convert html into pdf/a-3.
We also referred to this link: Converting HTML to PDF with IE | Syncfusion
But IEConverterSettings which is supposed to be a part of Syncfusion.HtmlConverter namespace is not found in Syncfusion.HtmlToPdfConverter.Net.Windows nuget package.
Please guide. Any example code HTML to PDF/a-3 conversion is highly appreciated.
IE rendering engine does not support conversion in .NET Core platform. It will only support in .NET Framework platform.
So you can use blink converter setting in .net core.You can't set conformance directly, but you can apply the conformance to an HTML-converted pdf.
Sample : https://www.syncfusion.com/downloads/support/directtrac/general/ze/ASP.NETCore1180248503
Please refer below documentation page
https://help.syncfusion.com/file-formats/pdf/working-with-pdf-conformance#pdf-to-pdfa-conversion
Please let us know if you need any further assistance in this.
Hi Santhiya,
Thanks for the reply.
Performance is important aspect in our application. We will consider using string to pdf/a-3 conversion directly for our implementation.
But the file attached fails the A3 compliance test in VeraPDF with the code below:
public static void A3WithEmbeddedFont()
{
//Create a new PDF document.
PdfDocument document = new PdfDocument(PdfConformanceLevel.Pdf_A3B);
//Add a page to the document.
PdfPage page = document.Pages.Add();
//Create PDF graphics for the page.
PdfGraphics graphics = page.Graphics;
string fontFile = "Arial.ttf";
//Read a font file stream.
Stream fontStream = new MemoryStream(File.ReadAllBytes(fontFile));
//Create a new PDF true type font instance.
//PdfFont font = new PdfTrueTypeFont(fontStream, true, PdfFontStyle.Regular, 12,);
PdfFont font = new PdfTrueTypeFont(fontStream,12, true, true);
//bool isUnicode = font.Unicode;
//Draw string to PDF page.
graphics.DrawString("Hello World!", font, PdfBrushes.Black, PointF.Empty);
//Save the document.
MemoryStream memoryStream = new MemoryStream();
//Save the document.
document.Save(memoryStream);
//Close the document.
document.Close(true);
WriteStreamToFile(memoryStream);
}
public static void WriteStreamToFile(MemoryStream stream)
{
string fileName ="sync-invoice-" + DateTime.Now.ToString("yyyyMMddHHmmssfff") + ".pdf";
var file = File.Create(fileName);
stream.WriteTo(file);
file.Close();
stream.Close();
Console.WriteLine($"{fileName} created successfully!!!");
}
We need your support as we are considering Syncfusion PDF as a tool for our application.
We suspect that the document contains the trail watermark in it. Due to this, the conformance is Invalid. This is not an issue. To overcome this, we must apply the registration license key to avoid a trial watermark and it will be resolved.
Please use the below code snippet to apply license :
Syncfusion.Licensing.SyncfusionLicenseProvider.RegisterLicense("Your License Key"); |
we have attached the output document for your reference:
https://www.syncfusion.com/downloads/support/directtrac/general/pd/Output272525247
Please find the below steps to add licensing to the pdf document
Please let us know if you are facing any issues with any of the above steps. We request you try this on your end and let us know the result. If still you are facing any issues, we request you to share more details about the issue like issue screenshots/ documentation/ video demos to understand the issue more clearly and provide you the accurate details.
Hi Irfana,
Thanks for reply. Your solution made my day. 👌😌😌😌