I am using Microsoft.Office.Interop.PowerPoint assembly to do presentation manipulations in VSTO-Addin application.
I figured out that the method:
Slides.InsertFromFile(string FileName, int Index, int SlideStart, int SlideEnd)
does not work when the inserted slide(s) contain SVG image.
There is no exception but when the presentation is opened in PowerPoint the image is displayed with a "red cross" sign like the image is missing, or the link to it is missing.
Further, I have investigated the PowerPoint file content (by renaming it to .zip). I figured out that when I use the interop method there are no copied binary files in the \ppt\media folder. When I insert SVG file directly from PowerPoint the same directory contains the files: image1.png and image2.svg
So, I think that Microsoft's API does not handle this case - insert of slides with SVG files.
Any ideas on how to go further with this?
Used versions:
Microsoft PowerPoint 365 ProPlus: Version 1812 (Build 11126.20188)
Microsoft Windows: Version 1803 (OS Build 17134.472)
Microsoft.Office.Interop.PowerPoint.dll 15.0.0.0 (C#)
This question helped me learn how to embed fonts in my VB 2010 application -> How to embed fonts for Use in a Visual Basic Project?
There is no UseCompatibleTextRendering property, however, for a ComboBox or a TextBox.
Is it possible to use an embedded font for a ComboBox or a TextBox?
While I was not able to use Fonts embedded as resources for a ComboBox and a TextBox, I was able to use fonts installed in the same directory as my application.
When I added the fonts (installed in the directory of my application by the installer) using this code, the UseCompatibleTextRendering property did not seem to matter:
If _pfc Is Nothing Then
_pfc = New PrivateFontCollection
End If
For Each fontfile As String In System.IO.Directory.GetFiles(filepath & "\Fonts", "*.ttf")
_pfc.AddFontFile(fontfile)
Next fontfile
My goal is to creat a gif from (42) images that I got (screenshots from a graphic after a small rotation).
I managed to find some ways to do it, but each time I must instal some package/component/library (I'm not familiar with those...)
A gif is a succession of images right? Isn't there a easy way to "stick" those image on after an other as a gif? Or there is nothing in visual studio for that (I found somewhere in the project tab ---> add a component ---> image.gif but i can't manage to do anything with it)
Building my first Windows Phone 8 app and I am bringing in a few icons to use in the appbar. As I am picking the icons in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v8.0\Icons\Dark I see that there is a file called DarkIcons.dll.
Can I use this dll as a resource file and then bind to icons in it?
If so how does that binding work? What does the binding look like?
For AppBar icons, you should use the white "dark" icons in that folder or from other resources like modernuiicons. Add these to your project as a resource and set the icon to be this image. If your application is used on a device that has a light theme, the phone will turn the icons black for you. No need for you to do anything!
Well. You need not to do anything with .dll file for App Bar icons. You need not to worry about that dll file. Because while you create the new project, all dll files will be initiated. This dll is the primary file. Windows sdk will care about more than you
Simply copy and paste the desired icons from "dark" folder in the solution explorer.
Simply call that image and you can use all icons like this.
If your phone theme was dark, then the colors of icons will be light and vice versa.
Hope this could be useful to you. All the best.
I want to create a COM dll that will take any Word file and generate an image file of the first page of the document. I have already done this using the IExtractImage functionality of the Windows SDK, but this only works if there is a thumbnail saved with the file. (Since the Word user has to make an extra effort to save the thumbnail by going down into the Advanced options of the Prepare | Properties dialog, most Word docs don’t have a preview available.)
(Unfortunately I am stuck with using COM because I am integrating this solution with an existing ASP web app that does not interact well with .NET.)
One approach I am considering is using a PDF-generating SDK to generate a PDF of the file, or ideally a PDF of just the first page of the file, and then generate the preview image from the PDF. (I don’t have access to Adobe’s proprietary PDF SDK, but if it could be shown to work well for this solution, I would look into purchasing a license.)
Ideally I would like to be able to generate a preview of many other (non-image) file types besides just a Word doc.
I notice that Google now provides a preview of many kinds of files, and I am wondering what approach they have used.
Any thoughts, clues, suggestions, and/or insults are welcome.
Thanks.
The thumbnail from the old OLE-Automation property pages is a very small (not even anti-aliased) black & white Metafile that does not look any good these days. Within classic VB6 or VBA, you can trigger saving the thumbnail with a few lines of code (If I remember correctly). However, Winword, Excel etc. are automated by loading the Gui application invisibly and this does not always work in a (web) server context. Consider to thumbnail the documents while uploading / virus scanning but not from inside a DLL that gets loaded into the web server.
The google approach builds most-likely upon some open-source components that do not work under classic ASP either.
ASP? You could use 2JPEG. It support 275 formats (including Word, Excel, Publisher & Powerpoint files.) The vendor recommends calling 2JPEG as a scheduled background task so you don't impact performance.
Here's a couple of examples:
Command line syntax. You can start in from a batch file or from the Windows Task Scheduler:
2jpeg.exe -src "C:\In\*.*" -dst "C:\Out"
Launch command line from Visual C++ application:
ShellExecute(NULL, "open", "2jpeg.exe", "-src \"C:\\In\\*.*\" -dst \"C:\\Out\"", NULL, SW_HIDE)
From Visual Basic:
Shell ("""2jpeg.exe"" -src ""C:\In\*.*"" -dst ""C:\out""")
Delphi syntax:
ShellExecute(0, 'open', PChar('2jpeg.exe'), PChar('-src "C:\In\*.*" -dst "C:\Out"'), nil, 0);
PERL script on Windows server:
exec '2jpeg.exe -src C:\In\*.* -dst C:\out';
VB Script code example:
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run """2jpeg.exe"" -src ""C:\In\*.*"" -dst ""C:\Out""", 1, True
Set objShell = Nothing
JavaScript code example:
var objShell = new ActiveXObject("Shell.Application");
objShell.ShellExecute("2jpeg.exe", "-src \"C:\\In\\*.*\" -dst \"C:\\Out\"", "", "open", "1");
PHP code example:
<?php
echo exec('2jpeg.exe -src "C:\In\*.*" -dst "C:\Out" -oper Resize size:"800 600" -jpeg quality:50');
?>
Launch 2JPEG from C# application:
System.Diagnostics.Process.Start("2jpeg.exe", "-src \"C:\\In\\*.*\" -dst \"C:\\Out\"");