Converting a Japanese doc to pdf outputs boxes instead of hieroglyphs - libreoffice

I'm developing a service which is supposed to convert a document of different formats to pdf. All works just fine with English documents, but with Japanese the result leaves much to be desired. Namely, instead of hieroglyphs I'm getting just empty boxes - 🬀
My service is running as a Windows container and the base image is mcr.microsoft.com/dotnet/framework/runtime:4.7.2-20210209-windowsservercore-ltsc2019
I tried to install different fonts like MS Mincho or MS Gothic with no luck

Have you checked if the installation of these fonts succeeded? Installing fonts on Server Core is not trivial. We're currently working on putting out an official guidance on how to install fonts on Server Core for Windows containers. In the meantime, have you tried the Windows or Server images? They are larger images, but they contain other fonts.
The caveat, is that DotNet did not build an image on this base, so you'd have to build one leveraging the docker file they publish. For example, for the image you referenced, this is the dockerfile: https://github.com/microsoft/dotnet-framework-docker/blob/d4095f39459c58f1951abbf21cf0a2b95458fac4/src/runtime/4.7.2/windowsservercore-ltsc2019/Dockerfile
You'd have to change the FROM statement on the dockerfile to mcr.microsoft.com/windows/server:ltsc2022 for Windows Server 2022 or mcr.microsoft.com/windows:1809 for Windows Server 2019.

Related

Unity Graphics White Screen Problem (Graphics Problem?)

My Unity Editor was showing a blank white screen when trying to start a project. Image here:
This is for the Karting Microgame. When it loads it only displays a blank screen. When clicking the play button there is sound but nothing showing on the screen. This issue also occurs for other Unity3D microgames. I suspect it is an error with the graphics setup or maybe a bug?
Technical details:
Dell G15 laptop
Ubuntu 20.04
Unity version 2020.3.21f1, installed via Unity Hub
NVIDIA Graphics Card (NVIDIA GeForce RTX 3060 GPU)
NVDIA Driver Version 470 (https://packages.ubuntu.com/focal/nvidia-driver-470)
I also have an Intel integrated graphics card on my machine. Tried switching to integrated graphics via the sudo prime-select intel command but it didn't work. Also tried installing Dell G15 graphics drivers from the Dell website but it seems like they only have Windows graphics drivers. Currently the screen is still blank.
Relevant links:
Unity forum discussion, have the exact same problem except for Ubuntu:
https://forum.unity.com/threads/uni...n-problem-might-know-the-real-problem.545441/
Dell graphics driver link, but seems to only have for Windows:
https://www.dell.com/support/home/en-us/product-support/product/g-series-15-5510-laptop/drivers
Tutorial on switching graphics cards. First tried updating my drivers via the ubuntu-drivers command from my existing 470 version to the recommended 510 version, but ran into an error saying my computer holds broken packages. Then tried switching to Intel integrated graphics card via the prime-select command but it caused my GUI to break (had to switch back to NVIDIA via the command line.)
https://www.linuxbabe.com/desktop-linux/switch-intel-nvidia-graphics-card-ubuntu
Any help would be appreciated.
Open windows in safe mode and try again also there might be other programs open that are causing the blank screen for example vpn could cause it
I need to share this!
Try this:
In your project, delete the Library folder. I found that CurrentLayout-default.dwlt in particular must be deleted, so you can try that first if your project is big and want to avoid long rebuilding times.
In ~/.config/unity3d/Preferences/Editor-5.x, delete the Layouts folder
In ~/.config/unity3d, delete the Browser folder
In ~/.config/unity3d, delete the Editor folder (there is one sub-folder per editor version but the serial number cannot be trivially matched with a human-readable version, so maybe just delete the whole folder)
Restart the project
I found 1, 2 & 3 to work in my case, and only 1+2 or 2+3 not to work. At least it should work when installing a new editor / re-installing an editor version. I also did 4 at some point so it may be needed for editor versions already installed. I did 2 at the beginning so not sure if required.

wkhtmltopdf amazon linux won't encode emoji

I'm trying to generate a PDF via wkhtmltopdf in an Amazon Linux os, everything works fine, but when i try to use emoji on the HTML, the fonts break and the emoji is displayed as a black box.
Before deploying, i tried locally and it works, locally i have Ubuntu, so my guess is that i'm missing something (fonts?) in the production (the amazon linux instance) server. I tried to install Google Noto font but nothing happened. I'll attach 2 screens of the same HTML page, generated by the same command via wkhtmltopdf:
Local (Ubuntu):
Production (Amazon Linux):
As you can see, even the font below the broken emoji is not rendered as aspected, i'll add the command i use in both servers:
/my/path/to/wkhtmltopdf-amd64/bin/wkhtmltopdf-amd64 --lowquality 'file:///my/path/to/page-test-pdf.html' '/home/user/test.pdf'
Thanks for your time.
You can find a solution to a similar issue here basically twemoji.min.js replace the emoji with the corresponding image. Regarding the weird font spacing issue, you can use a monospaced font like roboto mono or something you like.
If you are running PHP 7.x, I have been having problems with the wkhtmltopdf extension within a dockerized image. We were trying to use font awesome and the text just did not render correctly. There were some compilation issues that caused this.
The problem was resolved when using the following binary https://github.com/madnight/docker-alpine-wkhtmltopdf
Hope this helps you forward.
EDIT: You will also have to have all fonts used installed as system fonts iirc otherwise wkhtmltopdf will refuse to work as it cannot find the font

How to deploy an Office VSTO add-in using Visual Studio 2017

I've created an Outlook add-in, debugged and works fine. I want to be able to package it up for distribution. This is for a very limited audience 5-10 people. What are the steps to doing so?
I tried Build | Publish which appears to work (using options of local filename and CDROM install location), but creates a massive 1.5MB setup.exe file and when it is executed, takes forever (it appears trying to contact some remote server and times out and pops an error, although the add-in appears to be registered).
Looking online, I found references to creating a SetupProject or using InstallShield Limited addition, but none of those appear to apply to Visual Studio 2017.
I'd be happy if I could just provide my DLL and a .reg file -- this is for a small set of 5-10 power users.
What is the simplest way to deploy this add-in?
The easiest way is Build | Publish. Just disable any online activities if you don't want it. You can do that in Project -> Settings -> Publish. Check your "Updates" settings for example.
You can download a Visual Studio project type from here:
https://marketplace.visualstudio.com/items?itemName=VisualStudioProductTeam.MicrosoftVisualStudio2017InstallerProjects
This will allow you to deploy the package, but it's somewhat buggy in my opinion. Also, the link above does not have any documentation. You have to go to another page for that and the answer is buried in the comments:
https://msdn.microsoft.com/en-us/library/ybshs20f(v=vs.90).aspx
The ClickOnce has worked more consistently for us, however. Just right-click and select Publish on the Project.
It is a long ways off from the old InstallShield LE process, which allowed you to customize the entire process including images, click-through licensing, etc.
But the InstallShield LE had it's own set of issues, and seems to have been all but abandoned.
It may be worth looking at other 3rd-party tools like WiX (http://wixtoolset.org/) to get things installed correctly, or even manually writing your own installer to get things put where they need to be.

Error when opening Word document that was created by VSTO Template

I have created a new Visual Studio Word 2010 Template project, now I want to deploy it using a Windows Installer setup.
I followed this tutorial using Visual Studio 2012 with InstallShield 2013LE.
After installing the setup and opening the Word Template, it seems to work fine. However, after saving the template as *.dotx-document and opening it again the Installing Office customization dialog appears.
The message says There was an error during installation: Downloading file file:///[Path to the dotx file]/WordTemplate.vsto did not succeed.
To check whether I've made an error creating the setup and registry entries, I also tried Advanced Installer 10.9 Office Add-In setup, that creates the required entries automatically. It also fails with the same error message.
There is nothing special about the VSTO Addin. I started a new project for testing purposes, that adds a ribbon and a header to the Word Template file.
Finally I tried the built in Click-Once installer, with success, newly created documents can be opened without any exception. But it comes with some limitations. I would like to add some files and let the user choose the installation path, what doesn't seem possible.
So what am I missing to deploy my VSTO AddIn?
I believe that such a problem is coming from proxy server issues. The proxy server on the client machine is blocking the download of your vsto file that is considered as an executable file.Unfortunately the only solution I see was stipulated in an old post proposing to zip your installer and to send it to users ( which is not optimal, I must agree).
You must also run a command to clear the app cache any time you deploy (from your windows console):
rundll32 dfshim CleanOnlineAppCache
Hope that helps !

How to deploy an Excel XLL Add-In and automatically register the Add-In in Excel

I have developed an Excel XLL using ExcelDNA and C#. I am at the point where I would like to begin testing the deployment, but cannot find much information that actually provides steps that work.
My project was developed as a Class library with ExcelDna references. In the .dna file, I have the code below that will pack all resources into a packed version of the XLL (i.e. the Pack="true" attribute).
<DnaLibrary Name="ExcelXLL" RuntimeVersion="v4.0" Language="C#">
<ExternalLibrary Path="ExcelXLL.dll" LoadFromBytes="false" Pack="true" />
I would like to deploy the packed XLL to the target machine in the path:
%APPDATA%\Microsoft\AddIns
In order to automatically register the XLL with Excel, I need to add a registry key that depends on the version of Excel that the user has.
For instance, on my computer (Windows 7 64 bit running Excel 2007 32-bit), I would need to add a registry key to the following path:
HKEY_CURRENT_USER\Software\Microsoft\Office\12.0\Excel\Options\
The key would be type REG_SZ with the name OPEN (or OPEN1, OPEN2, etc.) and the value
/R "ExcelXLL-packed.xll"
I have 2 problems though. The first is in determining which version of Excel that the user has to get the correct path and the 2nd is to determine the correct OPEN version that I need to create (for example, if the user already has OPEN, OPEN1, and OPEN2 then I would create an OPEN3 key).
I am trying to do the installation using either the Setup and Deployment project or a InstallShield LE project and cannot determine how to go about this. Does anyone know how to do this or a better way of doing it?
EDIT 1:
I have done a great deal of research on this and have looked at several windows installers.
In the Package and Deployment and InstallShield LE, I can get the install/uninstall to work by putting an installer class into my class library and bundling project output with the install. In this approach, I handle inserting/removing the registry key using the installer class. The problem that I have is that the user must uninstall first before running a new install (no update capability).
I downloaded the Setup Factory demo version and can get install/update to work but cannot do the framework check (not shipped with the demo). Also, the uninstall fails (though I may be able to get this to work with some more investigation).
I am interested in using the WiX installer, but would like to know if anyone has a sample of how to perform the deployment using WiX. I would also like to know if I need to use the installer class or if there is a different way to handle the search for the OPEN[n] key under HKCU\Software\Microsoft\Office[Version].0\Excel\Options. If I were to use the project output to enable the installer class, then I need to have 2 separate target directories (one under Program Files for the basic project output and one under %appdata%\Microsoft\AddIns for the packed XLL).
Any help is greatly appreciated.
Thanks,
Lee
To detect Excel 32-bit vs. 64-bit, you can check the registry: Detect whether Office is 32bit or 64bit via the registry
For the OPEN, OPEN1, OPEN2 etc. you typically need a Custom Action in the install script that enumerates the keys.
Using IsWix and Wix 3.7, I was able to resolve this.
Useful links for how to register the components are as follows:
For generating a C# class to handle Windows Installer Custom Actions:
http://www.codeproject.com/Articles/132918/Creating-Custom-Action-for-WIX-Written-in-Managed?fid=1599130&df=90&mpp=25&noise=3&prof=False&sort=Position&view=Quick&spc=Relaxed&select=4131367&fr=1#xx0xx
http://blogs.msdn.com/b/jschaffe/archive/2012/10/23/creating-wix-custom-actions-in-c-and-passing-parameters.aspx
For setting the property of the CustomAction.config file to Content
WIX Custom Actions built for .Net Framework 4.0 does not work? Ways to resolve?
EDIT 1:
For general knowledge on WiX (Very important)
http://channel9.msdn.com/blogs/scobleizer/wix-team-the-most-used-piece-of-software-at-microsoft-and-its-open-source#Page=2