I am using graph api on my server to convert from msoffice file to pdf file.
Converting a typical docx file to a pdf file works fine.
But even though it's less than 1MB in size, docx files with math symbols don't work.
Thanks for any help!
The using api is as follow:
https://graph.microsoft.com/v1.0/users({my ID})/drive/items/{fileId}/content?format=pdf
The error response is as follow:
"error": {
"code": "generalException",
"message": "Error from Office Service. Url=https://wordcs.officeapps.live.com/document/export/pdf HttpCode=InternalServerError cert=subject:;thumbprint: ResponseHeaders=X-ErrorCode: WordConversionTimedOut\r\nX-ClientCorrelationId: b60e4e7c-94b5-4203-8371-920d8f2d53c5\r\nX-ServiceCorrelationId: b60e4e7c-94b5-4203-8371-920d8f2d53c5\r\nX-ErrorCategory: Fatal\r\nX-IsRetriable: False\r\nX-ConversionTimeInMs: 28046.3516\r\nX-FileDownloadTimeInMs: 281.2552\r\nCache-Control: private\r\nDate: Tue, 19 Apr 2022 07:23:25 GMT\r\nServer: Microsoft-IIS/10.0\r\nX-AspNet-Version: 4.0.30319\r\nX-Powered-By: ASP.NET\r\n",
"innererror": {
"code": "OfficeConversion_Fatal"
}
}
Related
I want to upload a video using the instagram graph api however the API asks for an url (and not a local path) for the video parameter. The video I want to upload is on my desktop (local) so I don't know how I can convert it so it works.
When I put a local path instead of the url I get the following message:
`
{
"error": {
"message": "The video file you selected is in a format that we don't support.",
"type": "OAuthException",
"code": 352,
"error_subcode": 2207026,
"is_transient": false,
"error_user_title": "Unsupported format",
"error_user_msg": "The video format is not supported. Please check the specs for the supported streams format",
"fbtrace_id": "AA3qcWZCmMsp0OfEE_m1cLJ"
}
}
`
I'm having a problem getting the JSON list of some very basic information I've put together in a google sheets file. I have ensured my API key is unrestricted and that the sheet itself is set to public,
I have also made sure that the google sheets API is enabled however I keep getting this error;
{
"error": {
"code": 400,
"message": "Unable to parse range: TestingRealtimeData",
"status": "INVALID_ARGUMENT"
}
}
The link to the original page is here;
https://docs.google.com/spreadsheets/d/1sT49JTaVGp5rt56A0hjs4WPVYDJDAMrjesqxU6RWrwo/edit#gid=0
And the published web page here;
https://docs.google.com/spreadsheets/d/e/2PACX-1vR3lrj8g2K6e47e3hTQmRkKiP5Q88yBGcqxO8YtaLH1pfOeHTg8wf4MtCnw_92TMizwHA68Xt1xu5PI/pubhtml?gid=0&single=true
Any idea what could be causing this?
Thanks in advance
want to convert doc file to pdf file using Adobe pdf service api
Long story short it has two parts:
make a post request ( providing require parameters ) and from header take x-request-id
make a get request ( providing require parameters ) and as responce you will get your pdf documet
it is working fine for docx to pdf, but for doc to pdf it is showing this responce instead of pdf document
{
"cpf:inputs": {
"documentIn": {
"cpf:location": "InputFile0",
"dc:format": "application/vnd.openxmlformats-officedocument.wordprocessingml.document"
}
},
"cpf:engine": {
"repo:assetId": "urn:aaid:cpf:Service-1538ece....caac2a07799503a430"
},
"cpf:status": {
"completed": true,
"type": "",
"title": "For application/vnd.openxmlformats-officedocument.wordprocessingml.document mime-type The input file appears to be corrupted and cannot be processed.; transactionId=XcYuSVqy7s80GL897ZHhQGU5nEl0D5Xp",
"status": 400,
"report": "{\"error_code\":\"CORRUPT_DOCUMENT\"}"
}
}
PS1 - i tryed d/f -2 doc files but not working for any of that.
PS2 - in document it is saying that this api can convert doc to pdf click here to see documentation.
Create an upload session to upload large files to oneDrive.
Below is the request address.
https://graph.microsoft.com/beta/users/{userId}/drive/root:/UploadFiles/{fileName}:/createUploadSession
Request Body
{
"item": {
"#odata.type": "microsoft.graph.driveItemUploadableProperties",
"#microsoft.graph.conflictBehavior": "rename",
"name": "largefile.dat"
}
}
An Invalid request error occurs. What's wrong with it? I watched the tutorial and tested it.
POST /drive/root:/{item-path}:/createUploadSession
Content-Type: application/json
{
"item": {
"#odata.type": "microsoft.graph.driveItemUploadableProperties",
"#microsoft.graph.conflictBehavior": "rename",
"name": "largefile.dat"
}
}
https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-beta#create-an-upload-session
As Shiva suggested in a comment on the question, the issue is that the value of #odata.type is not correct for this case. In general you should not provide it at all as the schema is strongly typed and therefore the appropriate value can be derived without any client-driven hints.
I am trying to upload a document which has special character in it. The JSON string is
[{
"type": "add",
"id": 1234,
"fields": {
"copyrightline": "© 2005 Some company. All Rights Reserved."
}
}]
When i remove '©' from the json, i am able to upload the document. When i have the character '©' the below is the error
AmazonCloudSearchDomainException: The request signature we calculated
does not match the signature you provided. Check your AWS Secret
Access Key and signing method. Consult the service documentation for
details. (Service: AmazonCloudSearchDomain; Status Code: 403; Error
Code: SignatureDoesNotMatch; Request ID:
d11a2497-aeac-11e9-b6fb-db6602f3004a)
Tried changing the encoding (UTF-8, UTF-16 and UTF-32) but with no success.
Here is the code which push the above string to CloudSearch
UploadDocumentsRequest uploadDocumentsRequest = new UploadDocumentsRequest();
InputStream inputStream = org.apache.commons.io.IOUtils.toInputStream(testDataString, "UTF-8");
uploadDocumentsRequest.setDocuments(inputStream);
uploadDocumentsRequest.setContentType(ContentType.Applicationjson);
uploadDocumentsRequest.setContentLength((long) testData.length());
UploadDocumentsResult uploadDocumentsResult = client.uploadDocuments(uploadDocumentsRequest);
Found out that the issue is with setContentLength(). If the length is invalid the error is thrown. So the following code change made sure it works.
uploadDocumentsRequest.setContentLength((long) cloudSearchAddRequest.getBytes("UTF-8").length);