Posts

Showing posts from 2025

Failed to create application customizer ClientSideExtension.ApplicationCustomizer .... Extension failed to initialize for componentId

if you see a message like this, usually with your ApplicationCustomizer broken:  sp-pages-assembly_en-us_c26a4253cc168135f82cb4fe78c6c5f8.js:409 Uncaught (in promise) Error: Failed to create application customizer 'ClientSideExtension.ApplicationCustomizer.0da391cc-9f86-49d2-8d2a-5bf70a52ba12'. Error information is 'Extension failed to initialize for componentId "0da391cc-9f86-49d2-8d2a-5bf70a52ba12".'.     at sp-pages-assembly_en-us_c26a4253cc168135f82cb4fe78c6c5f8.js:409:112695     at async Promise.all (new-proj/index 0) that usually means that YOUR code threw an exception, so start debugging line by line to find it. SAY WHAT???? let me explain whats going on behind the scenes... our friendly SP Team wanted to protect their dear pages, so basically all your SPFX code is double or tripled wrapped and actually swallows deeply any real exception, and just states that the attempt to run your code (create application customizer / initialize component) has failed....

C# Print PDF programatically

 Implement this answer https://stackoverflow.com/questions/47857500/c-sharp-how-to-programmatically-print-an-existing-pdf-file-using-printdocument#answer-48537329 1. Make sure you install (via NuGet)  PdfiumViewer   but only version 2.10.0 other versions does quite a mess... then run this code and thats it              var path = @"C:\temp\test2.pdf"; using (var document = PdfDocument.Load(path)) {   using (var printDocument = document.CreatePrintDocument()) {     printDocument.PrinterSettings.PrintFileName = "test2.pdf";     printDocument.PrinterSettings.PrinterName = printersNames[pi];     printDocument.DocumentName = "test2.pdf";     printDocument.PrinterSettings.PrintFileName = "test2.pdf";     printDocument.PrintController = new StandardPrintController();     printDocument.Print();   } } Now please ask me how to get your printer name       ...