confluence PDF preview shows strange characters for Chinese
Asked by Paul DeSousa:

When I use the PDF previewer that contains a document that has Chinese characters, it shows strange characters instead of the normal hanzi. When the PDF is downloaded the characters are just fine, they are only mumbled in the previewer.

Characters such as the following ????? appears as 8E,\`


Answers:
author: Rui Rodrigues
body: Hi Robert,

[Link Preview for Confluence](https://marketplace.atlassian.com/plugins/com.xpandit.plugins.linkpreview-confluence) maybe helps you. Take a look.

Cheers,

RMRodrigues.

comments: author: Paul DeSousa
body: Great thanks. Quick question, how do I use it? There is no real documentation. I installed it and see no new macro. The pdf images are on in the configure section but they do not "pop-up"? please help.


author: Rui Rodrigues
body: Hi Robert,There is no macro, you only need to add a link pointing to PDF file and do mouse over that link, a popup will appear showing the pdf popup. Probably you need to add some configuration.If it's useful for you and you want use it, I can help you to configure that.Thanks.Cheers,RMRodrigues.


author: Paul DeSousa
body: Thanks so much Rui. I added a PDF link and mouse over and nothing. I am using Chrome and I do not have any pop-up blocker or anything. Any thoughts on how to get the pop-up working? If I click on the link, it does shows the PDF, but it always did that. I also tried a simple png file, same results...


author: Rui Rodrigues
body: Ok. Let's configure that.Firstly, the Link Preview apply the preview using configuration aka jQuery. So, do you have any CSS class on the link you've created? If so, you need go to Link Preview Configuration (JIRA Administration \> Add-ons \> Look and Feel Section and click on LinkPreview).Example: Your link has a CSS class : "custom-link". In order to configure Link Preview to preview the content of link you need to add the follow configuration on the Apply Elements text area:a.custom-linkSave this change and go back to the page that has the link and try it again.Do you have any doubt?Best,RMRodrigues.


author: Paul DeSousa
body: As simple as create a blank page with only a link to a png file via the "link" in the menu bar. Save that. Mouse over the link... ...nothing. I went to Confluence admin ... Link Preview (not JIRA). Nothing was listed in Preview CSS, and I could not add anything to it.In the Config section I have three sections:CSS Classes to Preview Content lists: a.filename and three others which sounds right to me. The filetypes lists both png and pdf, good thereNothing under Preview CSS, and cannot add any there.Sorry I am still lost...


author: Rui Rodrigues
body: Which CSS class are you using on you link?


author: Paul DeSousa
body: Ummm... None that I know of. When I click the link it takes me to <https://cww-us.comsol.com/confluence/display/BD/Copy+of+CN?preview=/76779423/76779419/COMSOL_5.1_CN_Price_List.pdf>, I did not add any specific CSS class. I clicked on link and added an attachment. Not sure what Confluence adds...


author: Rui Rodrigues
body: You can define Link Preview to work for all links but it's is not a good solution. The best solution, in this case, is edit your page and add a css class in your link. To do that you need edit the page and see the source of the pages as a HTMl (There is that option) and the \<a\> element related with your lin you can add this calss="my-custom-link". After save this change you need go to the Link Preview configuration and add this (a.my-custom-link) to the CSS classes.Can you try to do this?


author: Rui Rodrigues
body: Robert,TIP: If you add the class="external-link" you don't need add this configuration to Link Preview because it's configured by default.


author: Paul DeSousa
body: We lost edit as HTML when we upgraded to 5.7, if there is a way to do that again I would love that.


author: Rui Rodrigues
body: Yes, there is another solution. There is always a solution, or not (hehe). You can get it working by adding the Attachments macro. This macro list all attachments of the page. Each link has a css class "filename". Check if you have this class configured on Link Preview, otherwise, you can add this "a.filename" on your configuration.


author: Rui Rodrigues
body: Any progress on that? Is it working?


author: Paul DeSousa
body: I have the attachments macro. I ended up uninstalling the link preview as this turned out to be not a good solution for my user. They wanted the preview to be displayed without having to mouse over.Thanks for all your help though. I marked it as answered as I am sure it would of worked.


author: Nicolas Casel
body: Hi @Rui Rodrigues ,Does the 'Link Preview for Confluence' plugin work with Word files as well?Thanks in advance.Nicolas


author: Rui Rodrigues
body: Hi Nicolas Casel,Currently, the Link preview does not preview Word documents.Thank you.


author: Elizabeth
body: [SharpView High Resolution PDF Viewer for Atlassian Confluence](https://www.appfusions.com/display/SHRPVW/Home) supports Chinese characters - among other features. It has been supported, maintained, and updated for years, [since Nov 2010](https://www.appfusions.com/display/SHRPVW/Downloads+and+Notes).

Get eval license by emailing [info@appfusions.com](mailto:info@appfusions.com)

Here's a video (we do need new video :wink: ):

<https://www.youtube.com/watch?v=be2M_GUPBFk>

comments: author: Paul DeSousa
body: Thanks Elizabeth, we have no need for high resolution previews. We only display Chinese characters in the PDF preview, and this plugin I believe is a little more than needed, and too expensive for us at this time.