Word document parsed with insertOOXML replaces images on iPad only - ipad

I am working on an Office-js add-in that uploads the body of the document as OOXML, does some processing, and then "sets" the body of the original document to the processed one from our server using insertOOXML.
The processing inserts inline images around certain blocks of text. When the add-in is tested on Mac and Windows it works flawlessly. On the iPad however, the images look correct initially but if the document is saved and reopened all of the images are changed to match the first image. If the document is first processed on Mac then sent to the iPad, this is the case as well. The images look correct at first but after saving and quitting the images all match the first image.
I have retrieved the document from the server directly and have not been able to recreate this issue, which makes me think it is related to how the document's body is set.
A little more detail on our implementation: The document is uploaded as OOXML and is treated as a docx file. I'm reasonably sure that the processing on the server is bug free because we use the same code to process docx files elsewhere without issue. To set the document, it is requested in flatOPC and set like so:
Word.run(function (context) {
var body = context.document.body;
body.insertOoxml(docXML, Word.InsertLocation.replace);
return context.sync()
});
Where docXML is the document in flatOpc format.
Is anyone else having a similar issue? Otherwise is this an issue with our code, insertOoxml, or Word on the iPad?

Related

QnA Maker Manage knowledge - Problem Adding new URL

I have problems adding a new URL when I manage knowledge base in QnAMaker.
I've tried adding this Url but I get the error:
Failed to extract QnAs from the source "URL" - Unsupported / Invalid url(s). Failed to extract Q&A from the source.
I've tested deleting the footer, publishing the page and in this case the URL works properly.
Also, I tested other very similar URLs, like this one and this has been parsed successfully.
What could be the problem?
It would appear that something with the way the questions are encoded on that page is preventing QnAMaker's services from reading the text of the question/answer pairs. In order to get those questions, I was able to copy paste the whole list:
I put them all into a word doc (or equivalent program), and then saved it as a PDF:
Then uploaded this to QnA Maker, where it was able to read the question/answer pairs just fine.
The reason I used a PDF as opposed to a .txt file is so the alternate characters (the Spanish ? for example) would render as well as the bullets from the final question that caused so much grief for the initial renderer.
After left feedback in azure site, QnA Maker Team fixed it. Now, the url is parsed properly.

Transloadit Thumbnail Result Image Has Wrong File Extension Capitalization

I am using transloadit to generate a thumbnail image sent from an iOS app that saves both the original image and the thumbnail to Amazon S3. The files get get saved out correctly with one exception. The file name for the thumbnail does not retain the capitalization of the original filename for the file extension, i.e. JPG vs jpg. Here is my template:
I am using the fields to generate the custom path I want--which works fine, however, the output from the "store_thumb" step has this difference:
Is there any way to retain the capitalization? I realize I can just force all of my filenames from the app to lowercase, however, I thought maybe I am just doing something wrong. Any suggestions?
I'm part of Transloadit's developer support team.
First of all, let me assure you there's nothing wrong with what you're doing. Secondly, I've asked our engineers about the issue and we realized it's a limitation caused by our special usage of some of the conversion tools.
We'll do our best to address this on future versions, but we cannot commit on a date. So for now if it's causing you trouble, we recommend using lowercase letters.

Generating a docx file using Pandoc: images missing! Due to multiple requests?

I'm generating a markdown document using my Rails 4.2 app which includes images that are on the same server (in the public folder).
Using pandoc (pandoc-ruby 1.0.0), I want to convert the document into various formats, especially HTML (to preview it in the browser) and DOCX (to download it).
The preview in the browser works perfect. But when converting to DOCX, the images aren't included. I guess this is due to multiple requests to referenced images while pandoc is generating the document.
I have already experimented with setting allow_concurrency to true, but this didn't solve the problem. Also, it happens on both the development and the production environment (while in development, it takes a long time, and in production it doesn't - maybe due to some differences in timeout limits?).
I have already found a way to solve my problem by not referencing the images using an URL, but by embedding it as base64 string into the document. But this for sure can't be the solution of choice, as it tends to bloat up the HTML document a lot. Also, on production, I already get RuntimeError (Stack space overflow: current size 8388608 bytes) from pretty small embedded images. So I have to find a real solution.
Reference the images by file path instead of url if they are on the same server.

Opening a TIFF File from the Web Browser

I checked previous questions here on SO but I think I want my functionality to work a little different. I understand that .tif files are not natively supported in Internet Explorer and that an extension, such as AlternaTIFF, are available to remedy this. However, I would like the dialog to show up where the user can either save/open the file on the client side. I know that MS Windows Picture and Fax Viewer can open them, no problems.
The files are located on our servers and this will be an intranet site. Currently, I have a link to the files populate in the view but again, I'd like that option for the user to Save/Open the file.
I'm using MVC, which I'm a little unfamiliar with, and can't seem to figure this one out. Thank you.
You can do an action that returns a tiff by changing the headers so when someone clicks the link the file will get downloaded or using FileResult.
Example with FileResult (i find it easier): http://www.dotnetcurry.com/ShowArticle.aspx?ID=807
For saving them is just like uploading any file with MVC. This post can be useful http://haacked.com/archive/2010/07/16/uploading-files-with-aspnetmvc.aspx
My advice is that you convert them to .jpg or .png when uploaded using GDI+.
//You first upload the tiff to the server like the post above explains
//And then open and convert it to .JPEG
Bitmap bm = Bitmap.FromFile("mypic.tiff");
bm.Save("mypic.jpg",ImageFormat.JPEG);
And if you already have the urls of all the tiffs, you can always do a console app to convert all of them. Even if you need to use tiffs its a good idea to have .jpg versions to show on the web. You can even resize them to create previews and save some bandwith too! :-)

Streaming PDF SDK to iOS via HTTP

Are there any good SDKs available on iOS that will not only display a PDF, but will show it as it is downloading from a web source? It is perfectly fine to use a paid for library as long as it is commercial-friendly.
To clarify, the SDK must be able to show partial files as they are downloading, whether I provide the stream or otherwise. I would like to avoid CGPDFScannerRef due to how low level it is -- I have tried FastPdfKit as well but it will only show the whole PDF after it has been fully downloaded. Any ideas?
PDF is a structured format that consists of different types of data blocks such as TOC, text, fonts, colors, annotations and information about these blocks is saved at the end of the file. So this makes it impossible for CGPDFDocumentRef to open the pdf without all the data available.
However you can get around this limitation by linearizing the PDF file so that the metadata information will be put at the beginning of the file. I'm not sure but I think you can then use CGDataProviderCreateSequential in combination with CGPDFDocumentRef to parse a partially downloaded PDF file.

Resources