Try to run AutomaticTaskTemplateIds.ConvertToTranslatableFormat pdf's files

Hello,

My version of Software:

 - Trados Studio is 15.2.0.1041

 - dll Sdl.ProjectApi.AutomaticTasks.Conversion is 15.1.0.0.

 - Adobe Reader DC 19.021.20048

When i try to run the Task through API:

AutomaticTask task = createdProject.RunAutomaticTask(projectFiles.GetIds(),AutomaticTaskTemplateIds.ConvertToTranslatableFormat);

It freezes on the converting step:

2019-10-23 14:06:42,256 DEBUG ProjectApi.AutomaticTaskExecuter - Executed: project=2ccaf774-eae6-4db8-803c-782e39b7e782, task=Scan, duration=0s
2019-10-23 14:06:42,304 INFO ConversionTask - ProcessFile: C:\Temp\Trados.WebApi - DEV\Projects\2ccaf774-eae6-4db8-803c-782e39b7e782\en-US\Test_All.pdf
2019-10-23 14:06:42,304 INFO ConversionTask - ProcessFile: getting filter manager
2019-10-23 14:06:42,304 INFO ConversionTask - ProcessFile: getting converter
2019-10-23 14:06:42,678 INFO ConversionTask - ProcessFile: checking source language
2019-10-23 14:06:42,678 INFO ConversionTask - ProcessFile: checking target language
2019-10-23 14:06:42,678 INFO ConversionTask - ProcessFile: converting file

Doesn't convert to sdlxdiff file, but when i try to do the same process on the Trados Studio it works.

INFO [2019-10-23 14:06:25,118] ConversionTask - ProcessFile: C:\Users\Administrator\Documents\Studio 2019\Project Templates\Project 6\en-us\Test_All.pdf
INFO [2019-10-23 14:06:25,118] ConversionTask - ProcessFile: getting filter manager
INFO [2019-10-23 14:06:25,119] ConversionTask - ProcessFile: getting converter
INFO [2019-10-23 14:06:25,568] ConversionTask - ProcessFile: checking source language
INFO [2019-10-23 14:06:25,568] ConversionTask - ProcessFile: checking target language
INFO [2019-10-23 14:06:25,568] ConversionTask - ProcessFile: converting file
INFO [2019-10-23 14:06:27,385] ConversionTask - ProcessFile: completed
INFO [2019-10-23 14:06:27,521] ContentProcessingTaskImplementation - Batch task max thread count = 3

I disassembly the dll and see the line of code that freezes.

Class Sdl.ProjectApi.AutomaticTasks.Conversion.ConversionTask

FileTypeSupportUtil.ResolveLanguages(converter, executingTaskFile.ProjectFile.Project.SourceLanguage, null);
executingTaskFile.LocalFilePath = filenameWithDefaultExtension;
this._log.Info("ProcessFile: converting file");
converter.Parse(); -> This one and don't throw exception

Thanks for the attention 

Parents
  • Are you aware of the fact that PDFs are processed by Studio differently than other files?
    They are converted to DOCX first in the background and only the DOCX is then processed the usual way, i.e. converted to translatable format (i.e. SDLXLIFF).

    Personally, I doubt that this is handled automatically within the ConvertToTranslatableFormat method... I suppose that you are expected to handle it yourself in your code.
    Maybe someone else with hands-on experience with handling PDFs programmatically can comment on that...

Reply
  • Are you aware of the fact that PDFs are processed by Studio differently than other files?
    They are converted to DOCX first in the background and only the DOCX is then processed the usual way, i.e. converted to translatable format (i.e. SDLXLIFF).

    Personally, I doubt that this is handled automatically within the ConvertToTranslatableFormat method... I suppose that you are expected to handle it yourself in your code.
    Maybe someone else with hands-on experience with handling PDFs programmatically can comment on that...

Children