Download Highcharts graph as image results in weird characters - printing

I added the "Download graph as image" button to my Highcharts graph. But now I see that the downloaded image version has problems with the non-english characters, such as ä and è. It seems as if a script on the Highcharts-server is being contacted for the production of the image. Anything which could be done there? Here is an example of a graph.
Thanks for any hints!

You need to have utf-8 encoding on the page, instead of ISO-8859-1

Related

Why google sheets save as PDF doesn't show emoji in Cell?

Do you know why some times the emoji icons show normal and some times show as just empty square in google sheets , also when I save sheet as PDF the icon show as line ! , can anyone advise the reason ? what should i do ?
Here is a link of the sheet ( ICON in B24 )
https://docs.google.com/spreadsheets/d/1LRmyNlKSQjADz0bG_-mDf6w0LqEg7IcPgVizXF4C-Xc/edit?usp=sharing
this is the link were i took the icon from .
https://emojipedia.org/emoji/%F0%9F%8C%9E/
Thanks,
Why This is Impossible
Google Sheets does not export emoji to .pdf because it does not know what an emoji is. Google Sheets is able to display emoji when doing work not because Google Sheets itself can display emoji, but because your browser/operating system can. If everything was left only to Google Sheets, it wouldn't know how to display emoji at all.
The one exception to this is Noto Emoji (as already mentioned by Max Makhrov). Through this page, it can be seen that no font built into Google Sheets has the ability to display emoji except Noto Emoji. Even then, Noto Emoji only displays it as a black-and-white outline. Every other font available in Google Sheets does not have support for emojis.
If Google Sheets allowed the addition of custom fonts, this would be fixable. However, it is currently not possible to add custom fonts into Google Sheets. There are additional "advanced" fonts hidden in the "Fonts Dropdown->More Fonts" menu (one of which is Noto Emoji), but adding truly custom fonts is not possible.
Perhaps a correctly built extension could fix this issue. Currently though, no such extension seems to exist. One Google Sheets add-on called Free and New Font purports to add this functionality, but it has absolutely abysmal reviews and demands some very dodgy permissions regarding one's Google account. I have not tested it, and have intentionally refrained from linking to it because it seems nearer to a virus than actual solution. I would not want anyone skimming this to get the wrong idea.
All of that leaves us with no way (except Noto Emoji) to have Google Sheets recognize emoji; therefore, there is no way to use the built-in Google Sheets "Export as PDF" functionality and have emoji be exported correctly.
Alternatives
Since it is not possible to complete this task directly, I have provided some alternatives below.
Use Noto Emoji
Noto Emoji itself is the closest option Google Sheets has for exporting to .pdf which include emoji. The downside of this is that Noto Emoji only exports emoji as black-and-white outlines. If this is serviceable, Noto Emoji can be accessed by:
Selecting all cells with emoji in them.
Clicking the fonts dropdown menu.
Selecting "More Fonts" at the top of the list.
Searching for "Noto Emoji" and selecting it.
Pressing "OK"
Export Using Another Method
As OSM suggests, exporting as an .html document instead of a .pdf would retain colored emoji correctly. Another program can then be used to convert the .html document into a .pdf. Similarly (with even more jankiness), a screenshot of the document could be taken, and the image added to a PDF later. If access to Excel is possible, Google Sheets supports exporting to .xlsx, and Excel has better support for exporting emojis into PDFs.
The downside of this solution is that it requires numerous additional steps that take place outside of Google Sheets. If this is serviceable, refer to OSM's answer for steps to implement the .html solution, or Microsoft documentation for steps to implement the .xlsx solution.
Use Images Instead
Rather than using emoji, images could instead be used as this answer by pjmg suggests. Using the =IMAGE() formula (documentation here), a picture of an emoji could be pulled from an outside source. Google Sheets would correctly export that image when a .pdf file is created.
The downside of this solution is that it is cumbersome to find sources for external images, the images are not true emoji (which will be evident when editing the document), and if the host of the image goes down, exporting will no longer function correctly. If this is serviceable:
Find a website that hosts images of emoji. In this answer, jpmg suggests iEmoji. The Emojipedia website would also work.
Right click the image and click "Open in New Tab".
Copy the link and put it into an =IMAGE() formula in the desired cell.
For example (courtesy of jpmg), if you wanted the "face with tears of joy" emoji, you could use =IMAGE("https://s3.amazonaws.com/pix.iemoji.com/images/emoji/apple/ios-12/256/face-with-tears-of-joy.png") or =IMAGE("https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/120/apple/325/face-with-tears-of-joy_1f602.png")
Create New Functionality
If none of the above solutions are serviceable, it's possible to request that Google update their software to fix the problem. Max Makhrov has already submitted a bug report here, which can be voted on to improve the chances that Google updates things. Though, it should be noted: I think that this is technically all intended functionality, so a feature request might be a better route.
Furthermore, if anyone is particularly motivated, creating a non-shady alternative to the add-on I previously mentioned could also be a solution. Ultimately though, I suspect this would be a very time-consuming task for little gain.
Conclusion
It is not possible to use the built-in "Export as PDF" functionality in Google Sheets to get a resulting file with colored emoji. This is because there are no appropriate fonts available in Google Sheets. Workarounds exist, but none are optimal.
Solution
You can print easily with few steps, Colored and with any font.
1 - Add a dot in the right bottom corner to indicate the edge
and Go to File > Download > Web Page (.html)
2 - Open the webpage in your browser and print as a PDF
Edit with Pdf editor
3 - Open the PDF file with illustrator or a PDF editor, delete the grid and columns and rows.
Print and Enjoy :)
Running into the same problem, and so far the only work-around I have discovered is to go to File > Download > Web Page and then print the resulting HTML file for that sheet. You have to check the option in your browser's print dialogue to print background and images to get some of the formatting to print correctly.
I've reported this as an issue here:
https://issuetracker.google.com/issues/241147770
Please wote the issue if you want Google to solve it.
Note: when I use fonr Noto Emoji emojis are printed, but they are not colored.
To use this font select 'More Fonts' option.
The original solution: change the font
if you don't have to choose exact font, emoji containing cells that are formatted with Inconsolata or Sawarabi Mincho fonts are perfectly exported to PDF.
UPD. It appears that these fonts export correctly only certain emojis like arrows, card signs, etc... while others popular emojis are not exported correctly.
Notes
As #Osm noted:
failed with Inconsolata and Sawarabi Mincho see this
Noto Emoji seems to be the only font to work. Still Google has tons of fonts and we have no solid proof if some or any of them will work.
Chnaging the font seems to be the only programmable solution at the moment.
Vote the issue if you are effected.
Emojis are considered to be special characters.
So according to this, if you want to insert a special character, it is recommended you follow the steps mentioned in there.
As for the reason why the PDF is not exported in the way you expect it - this is due to encoding since emojis are special characters. I suggest you insert the emoji as an image and only afterwards export the spreadsheet.
Pdf translators cannot support exotic fonts like woof or csvg. commonly the html styles are
"Noto Color Emoji" (often via Google android platform apps)
"Apple Color Emoji" (used on Apple platforms such as iOS and macOS)
"Segoe UI Emoji" (as used by Windows platform in NotePad etc.)
Here the source text is on left in windows 11 notepad, as inserted say on a keyboard.
Then we can see in windows 11 notepad (!argh !why two apps same name), what it would look like if on the web as HTML.
Then from that print to PDF is on right and its not same as source !argh !argh, why the differences
so for above the pdf shows
Title: try.txt - Notepad
PDF Producer: Microsoft: Print To PDF
PDF Version: 1.7
Fonts:
CIDFont+F1 (TrueType (CID); Identity-H; embedded)
CIDFont+F2 (TrueType (CID); Identity-H; embedded)
CIDFont+F3 (TrueType (CID); Identity-H; embedded)
CIDFont+F4 (TrueType (CID); Identity-H; embedded)
PDF has enough trouble using TTF monochromatic fonts as shown above so google export fonts in the sample file are
 
<office:font-face-decls><style:font-face style:name="Arial" svg:font-family="Arial" /><style:font-face style:name="Cambria" svg:font-family="Cambria" /><style:font-face style:name="Liberation Sans" svg:font-family="'Liberation Sans'" style:font-family-generic="swiss" style:font-pitch="variable" /><style:font-face style:name="DejaVu Sans" svg:font-family="'DejaVu Sans'" style:font-family-generic="system" style:font-pitch="variable" /><style:font-face style:name="Linux Libertine G" svg:font-family="'Linux Libertine G'" style:font-family-generic="system" style:font-pitch="variable" /></office:font-face-decls>
and the plain text is
<table:table-cell table:style-name="ce1" office:value-type="string"
calcext:value-type="string">text:p😂</text:p></table:table-cell>
but on a web that is naturally colour enhanced since lol is considered naff however in any of the above fonts it would be a null character, or plain text in black and white.
For non font supported characters you could see Fonts: <#4> (Type3; embedded)
As explained by others simply export the html with html iconic characters and then print html to pdf where you can use the html emojis as plain text for find etc.

imagemagick convert pdf with text(no scan) to gibberish

I am processing pdf files with imagemagick to images but this particular file is processed to some really gibberish stuff
To simplify stuff I am doing simple
convert file.pdf out.jpg
Just an idea is that it is mix of text pdf and image pdf and this could cause troubles. Can you help?
Pages of document which are in text are converted to this gibberish, last page which is actually scan is fine
this is the link to the original
file
EDIT: I found out that also files without combination of text and scan are causing issues, actually files which contain text data, not scanned image. So the question is how to setup imagemagick to convert pdf with pure text to image without getting this output
Problem was with ghostscript 9.22,
update to 9.23 helps

Odoo POS ticket, large size with empty spaces

I´m using Odoo v9. I´m facing some problems with the POS module. At the time of printing a ticket every thing is shown properly, but for some reason there is a large empty space, before the content of the ticket an after it, wasting 2/3 of all the space.
I´m just using odoo and an EPSON TV88 printer, i´m not using the posbox. I guest it is a configuration problem, or something.
Any help, thanks in advanced.
Regards
You can remove extra space by reducing size of ticket from .xml file where ypu define template of receipt else you can also manage size from odoo. This located here:
Settings>>Technical>>Reports>>Paper Format
Also here you can create your own format also.

How to fix "error exists on this page" PDF error from prawn generated documents?

I'm generating PDFs in my Rails application using the Prawn PDF library. Everything is working great, but when opening the resulting PDF in Acrobat or Acrobat Reader the message below is shown:
An error exists on this page. Acrobat
may not display the page correctly.
Please contact the person who created
the PDF document to correct the
problem.
Adobe lists this as being fixed in their Acrobat 8.1.3 release notes.
1810668 Memory leak while printing
large document with images:

> When a large document is exported to a
PostScript, or sent to a printer for
printing "An error exists on this
page. Acrobat may not display the page
correctly. Please contact the person
who created the PDF document to
correct the problem" can occur. This
problem was encountered on certain
documents with a large number of
monochrome images, but has been
rectified in 8.1.3.Root: Fixes issue
found in 8.1.2.
But I'm seeing the issue in all current Versions of Acrobat Professional and Acrobat reader. My PDF does use a background image on every page, has lots of pages (usually 75+), and has lots of transparent images, but nothing that should be causing an error. Additionally Mac's Preview shows no issues, and if you press "OK" on the Acrobat error, everything is fine.
I ran the Preflight tool in Acrobat Professional to check for PDF syntax errors and found no errors but some warnings "Unbalanced q and Q operators".
This is for a customer facing application so I can't change settings to suppress the error in the PDF reader.
Any ideas on how I can get the error to go away?
As Mark noted "q" and "Q" operators must be balanced in a pdf file.
Prawn PDF library seems to have a bug. I found this in a comment of an open issue:
I made an workaround some weeks ago by
patching the prawn-library itself. The
root of this error is an "unbalanced
q/Q", which appears only in Adobe
Acrobat Pro preflight. I patched it by
adding an additional \q in the prawn
PDF-Generator.
https://github.com/sandal/prawn-layout/issues#issue/25
This was a bug in prawn, it should be fixed in the 0.11.1 release.

Search Words in pdf files

Is it possible to search "words" in pdf files with delphi?
I have code with which I can search in many others files like (exe, dll, txt) but it doesn't work with pdf files.
It depends on the structure of the specific PDF.
If the pdf is made of images (scanned pages) then you have to OCR each image and build a full text index inside the PDF. (To see if its image based, open it with notepad and look for obj tags full of random chars). There are a few utilities and apps that do this kind of work for you, CVision PDF Compressor is one that I have used before.
If the pdf is a standard PDF, then you should be able to open it like any other text file and search for the words.
Here is page that will detail some of the structure of a PDF. This a SO post for the same.
The components/libraries mentioned in the answer to this question should do what you need.
I'm just working on a project that does this. The method I use is to convert the PDF file to plain text (with pdftotext.exe) and create an index on the resulting text. We do the same with word and other office files, works pretty good!
Searching directly into pdf files from Delphi (without external app) is more difficult I think. If you find anything, please update here as I would also be very interested in that!
One option I have used is to use Microsoft's ifilter technology, this is used by windows desktop search and many other products such as sharepoint and SQL server full-text search.
It supports almost any office/office-like file format, even dwg, msg, pdf, and files in zip/rar archives.
The easiest way to use it is to run FiltDump.exe on any files you have, and index the text output.
To know about the filters installed on your PC, you can use ifilter explorer.
Wikipedia has some links on its ifilters page.
Quick PDF Library's GetPageText function can give you the words from a PDF as well as the page number and the co-ordinates of those words - sometimes useful for highlighting.
PDF is not just a binary representation. Think of it as a tree of objects, where an object node has some metadata and some content information. Some of these objects have string data, some don't. Some of these are even encrypted, and some are compressed. So, there's very little chance your string finder will work on any arbitrary PDF.

Resources