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 

  • 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...

  • Thank you for the reply.

    It's wierd, because i have this code working on two different machines and one works and another not.

    The version of trados that works it's : 15.0.1.36320 and dll Sdl.ProjectApi.AutomaticTasks.Conversion is 15.0.0.0.

    This is project created only with API:

    Thank for support.

  • Already solve my problem.

    First of all, an explanation like Trados Studio deals with pdf.

    The trados use a produt SolidFramework to convert pdf files into word and extract all text of file. This product have managed dll and unmanaged dll, when i try to run the convert he runs some unmanaged dll and i don't have the permission to execute them, because i am running the process in IIS with a application pool with applicationIdentity.

    The solution it's change the user of iis to a user that have permission in the folder of SolidFramework and to execute unmanaged dll like Administrator or something like that.

    Thank you for support.

  • I'd like to draw your attention to the EULA for Trados Studio as the use case you are working on here seems to be something you have developed to automate processes, simulating a server, accessing a single instance of Studio through IIS.

    That sort of solution is forbidden by the EULA since it is outside the scope of the intended use of a single licence of Trados Studio.

    If you have a need to deliver more than you can achieve with a single licence of the software I can put you in contact with an appropriate member of our team.  Alternatively you can explain what you are doing in case I have the wrong end of the stick?

    Paul Filkin | RWS

    Design your own training!
    You've done the courses and still need to go a little further, or still not clear? 
    Tell us what you need in our Community Solutions Hub