I have to create a RTF file using C++ and MFC. This RTF file will contain images with a link on each of them.
The RTF is always in memory, it's never written on the hard disk.
I need to insert an image in the RTF file at runtime(the image is not always the same). Is it possible to do so with MFC? I'm not sure if CRichEditCtrl can do that...
Thanks
See Insert image into Rich Edit.
Finally, the method at this page worked:
http://www.codeguru.com/Cpp/controls/richedit/article.php/c5383
Related
I am currently working on a project. I have an rtf file which contains some text and images both. I need to display those images and text from rtf to richtextbox in Visual C++. We are not using .Net frameworks or MFC's so everything is in Visual C++ only.
I do'nt have any idea how to do it. If anyone can guide me then it will be really helpful. Thanks in advance.
RichTextBox cannot load HTML. It can load only RTF or plain text.
There are 3rd party components that can convert HTML to RTF, but they don't really do a good job especially when dealing with images. I had done intensive research on this for my sticky notes product Notezilla.
You can use the Web Browser control to show your HTML.
I am new to VC++, I want to know if it is possible to insert an image created by my kinect camera to a RTF doc or MSWord doc using VC++ in a Win32Console Application? Any pointers on how can I achieve my goal? Thanks!
Yes, it is possible. I assume that you already have a way to get the image from the camera and save it to a file. RTF (specification) is an utter pig, but the spec will tell you how to add an image. Parsing an existing file to figure out where to add the image though, or creating a new file with the image already present, is an exercise I'll leave to you.
If you have any experience with COM then adding an image to a Word document might prove easier. This MSDN page (link) will help.
I need an animation in my program. My designer draws animation in Flash and provides me with *.fla file. All I need is to grab 30-40 PNGs from this file and store them within my internal storage.
Is it possible grab resources from *.fla with C++ ? Probably, some Adobe OLE objects can help?
Please, advice.
Thanks in advance.
If I asked an artist to make me an icon I wouldn't expect to need to write code to convert a .3DS model into a usable icon format.
You can save yourself a lot of time and hassle by having your designer use File->Export and give you PNGs of the layers and frames instead of a .FLA file if that's the format you require for your implementation.
If that's not possible for some reason then you can probably find a flash decompiler that has a command line option which you could launch from your program to extract assets as part of your loading sequence but that is generally frowned upon because this is not the intended use of the proprietary format for .swf/.fla anymore than you should design applications to extract source code from a binary executable.
Assuming
You are using CS5
The assets used internally in the FLA are already PNG's as you want them to be.
Then simply get the FLA saved as a XFL file, and you will be able to grab them from the library folder ( but then why not just get them to mail you the pngs ? )
So if for some reason you can only get access to the fla and not the designer, then you can do it programatically by renaming the fla to .zip, extracting.. and you have the XFL format.
I'm modifying a C++ application and I'd like to add the ability to print and existing PDF using the MFC printing logic (OnPrint...)
Is there any method to print a PDF into the MFC? Now I'm converting the PDF to a BMP but sometimes the quality is not so great.
Unless something's changed recently you need a 3rd party library to print PDF files. One direction you can take is to convert to PS and then use ghostscript to translate to printer speak. Ghostscript also has the power to convert PDF to PS.
I don't think MFC's own printing logic will work.
Adobe distributes a PDF ActiveX control (primarily for viewing PDFs in IE) that can also be hosted in an MFC application. It includes the following methods: Print, PrintAll, PrintAllFit, PrintPages, PrintPagesFit and PrintWithDialog.
In C++ I'm generating a PDF report with libHaru. I'm looking for someway to append two pages from an existing PDF file to the end of my report. Is there any free way to do that?
Thanks.
Try PoDoFo
http://podofo.sourceforge.net/
You should be able to open both of the PDFs as PDFMemDocuments using PDFMemDocument.Load( filename ).
Then, acquire references to the two pages you want to copy and add to the end of the document using InsertPages, or optionally, remove all but the last two pages of the source document, then call PDFDocument.
Append and pass the called document. Hard to say which would be faster or more stable.
Hope that helps,
Troy
You can use the Ghostscript utility pdf2ps to convert the PDF files to PostScript, append the PostScript files, and then convert them back to a PDF using ps2pdf.