Generate Pdf Using QCoreApplication in QT - visual-c++

I would like to generate Pdf using QCoreApplication instead of QApplication in QT.Is there solution for this? Thanks in advance.

I do not think you can create/write a pdf file using QCoreApplication. Writing a PDF file at the very mimimum requires rendering the text in a desired font. That, as far as I know, can be done only using a QPrinter, which requires QApplication to be constructed.
There are several open source pdf libraries which allow you to create pdf files. You could try iText, libHaru, or podofo for writing pdf files.

Related

Nodejs muhammara insert SVG to pdf, or read exist PDF with PDFmake content and save it as other

I am using NodeJS and I want to modify uploaded PDF file by add svg.
I tried to use Muhammara/Hummus and it is great to edit but it can not handle SVG, only JPEG.
I also Tried PDFmake, but as far i know, I can not read PDF with this tool, just create PDF from documentData obj.
Is there any possibility accomplish mentioned goal in Nodejs?
Regards

Diagrams Net (Draw IO) Link to open local file

I have a project documentation written in ASCIIDOC with editable PNGs and
I would like to create a link in my documentation that opens a local file directly in draw.io (diagrams.net).
Something like https://app.diagrams.net/file=/home/alex/test.png.
or https://app.diagrams.net/data={HEX DATA OF PNG}
My first stop was in the documentation: https://www.diagrams.net/doc/faq/supported-url-parameters
but I couldn't figure out how to transform my editable PNGs for the data parameter nor how to instruct the application to automatically open the upload dialog.
Any advice is greatly appreciated.

Convert .dae to x3dom

Is there a way I can render a 3D model (in .dae, I'm using SketchUp) into a x3dom? I looked up online, but can't find the way.
Hope someone can help.
You can load the COLLADA file in the VRML/x3d viewer bscontact from Bitmanagement (http://www.bitmanagement.com/en/download) and then "save state as" x3d, x3dom.
Or you can use the InstantReality framework and use aopt.exe to convert the collada file into x3d or in x3dom.

How to print a pdf file from windows store application

I am creating a windows 8 app in c# and xaml.
How can i print a pdf file on my system from this app without launching the pdf reader of windows.
If a commercial library is an option, you could try Amyuni PDF Creator for WinRT.
From the documentation, the code for printing a PDF file in C# using this library would look like this:
// Printing on a XAML Windows Store Application
// The field AmyuniPDFCreator.PDFCreator m_pdfCreator; contains an instance of the PDFCreator control
TypedEventHandler<PrintManager, PrintTaskRequestedEventArgs> m_printTaskRequestedEventToken;
// Registering the Application View for printing
void RegisterForPrinting()
{
// Request a PrintManager instance
PrintManager printMan = PrintManager.GetForCurrentView();
// Add a handler for printing events.
m_printTaskRequestedEventToken = printMan.PrintTaskRequested += m_pdfCreator.Document.PrintTaskRequestedEventHandler;
}
// Unregistering the Application View for printing
void UnregisterForPrinting()
{
// Remove the handler for printing events.
PrintManager printMan = PrintManager.GetForCurrentView();
printMan.PrintTaskRequested -= m_printTaskRequestedEventToken;
}
More details about the library can be found here.
Disclaimer: I currently work as a developer of the library
It is possible to achieve this without any third party library if you want to print it with a device.
This isn't working to create or write a ".pdf"[Pdf File). To make this happen without another library you could maybe try to write images directly into a pdf, but i can only reference here the Pdf Documentation.
First of all you have to render your pdf. You can do this with Windows.Data.Pdf.
You can take a look at an example here. The libary will handle the Pdf and you get some BitmapImages rendered.
This library can read, but not write ".pdf"
Now you have to print your Images(rendered pdf pages). For this you take the Windows.Graphics.Printing.PrintManager.
I would not recommend the msdn example in this case.
So have a first look at Windows Store Apps and XAML Based Printing.
And you will find another printing example with MVVM here: Printing from MVVM XAML Windows 8 Store apps.
If you just follow the examples you will achieve to print a pdf on paper some trouble.
How to add custom settings for your printer is explained at How to add custom settings to the print preview UI (XAML)!
Windows 8 doesn't have an API to do this, so you'll have to acquire one elsewhere - something that's capable of properly rendering a PDF for you, and that's going to mean a full-blown PDF API with all the bells and whistles (I'm not aware of any of these for Windows 8 that only supports printing).
If only PDF Sharp had a WinRT version, I'd recommend it in a heartbeat... unfortunately it doesn't (yet). Only ones I know of that have an API for WinRT are Foxit and Siberix Report Writer.

embed an image from sharepoint library in a pdf generated using itextsharp

I have an infopath form which when submitted generates a pdf file with the same form content(XML) using itextsharp library.
I have a node in infopath form that contains the URL of an image from a sharepoint picture library. How do i embed this image into the pdf file generated? Any solution with xslt modification in my xsl file that i am using for transforming the form XML content?
Thanks for the help!
Someone's actually using InfoPath? First I've heard. Wow. Okay, so there's over 400 questions tagged infopath, but still...
iText's general HTML->PDF functions should convert standard <img src="..."> tags to PDF just fine. If that's not an option for some reason, iText's new XMLWorker may do the trick, released with 5.1.0.
There's even a demo page up: http://www.lowagie.com/xmlworker

Resources