Document conversion API usage in .NET

20170412

means license has expired?

To renew - we required to pay, right?

@egormarkov,

Yes, your license is expired. You need to renew the license in order to get the updates.

Thanks. Sorry for the troubles.

@egormarkov,

You are welcome.

Hi Team. I got a question regarding watermark.

Is it support to be shown behind text?

@egormarkov,

Thank you for your inquiry.

Can you please elaborate your case?
Furthermore, we need following information in order to investigate this scenario:

  • API platform (Java or .NET)
  • API version that you integrated in the project

.NET, version 17.8.0.0

Before we was using version 3.1.0, there no watermark option and we develop our own watermark functionality. But it’s showing in front of text and because of that some text is difficult to read.

In 17.8 version we see watermark option - after we tried - it seems still showing in front of text. Is there any possibility to show it behind the text?

@egormarkov,

Thanks for sharing the details. We reproduced same issue at our end as well. Hence, we’ve logged it in our internal issue tracking system with ID:CONVERSIONNET-2401. As we have any update on it, we’ll notify you.

@egormarkov,

We have an update on CONVERSIONNET-2401. This issue will be resolved in 18.3 version of the API. As the release gets on-board, we’ll apprise you.

Hi Team.

Can you please advice why this file gives ‘PasswordProtectedException’? Demo PDF.pdf (809.8 KB)

@egormarkov,

Can you please share the sample code and tell us which version of the API you used for conversion process? We converted this file to word format using version 18.3 without facing any such exception using following code:

// Instantiating the conversion handler from custom common class
ConversionHandler conversionHandler = Common.getConversionHandler();

// Convert and save converted word processing documents.
// Returns paths to the converted word processing documents.
var convertedDocumentPath = conversionHandler.Convert(Common.inputGUIDFile, new WordsSaveOptions { });
convertedDocumentPath.Save("result-" + Path.GetFileNameWithoutExtension(Common.inputGUIDFile) + ".doc");

Output/Converted document - result-Demo PDF.zip (1.4 MB)

We are using html conversion. Version we are using is 17.8. Here is a code snippet:

var cfg = new ConversionConfig();
var ch = new ConversionHandler(cfg);
var options = new HtmlSaveOptions();
using (var str = new MemoryStream())
{
using (fileStream)
{
fileStream.CopyTo(str, 4096);
}
using (var htmlStr = ch.Convert(str, FileName, options))
{
}
}

here is an error:

PasswordProtectedException: +++++ Exception of type ‘GroupDocs.Conversion.Exceptions.PasswordProtectedException’ was thrown.
StackTrace:
at ? .?(Stream ?, LoadOptions ?)
at ? .? ?(LoadOptions ?)
at ? .? ?(Stream ?, LoadOptions ?)
at ? .?(FileDescription ?, Stream ?, LoadOptions ?, SaveOptions ?)
at ? .? ?(Stream ?, String ?, LoadOptions ?, SaveOptions ?)
at GroupDocs.Conversion.Handler.ConversionHandler.Convert[T](Stream fileStream, String fileName, LoadOptions loadOptions, SaveOptions saveOptions)
at GroupDocs.Conversion.Handler.ConversionHandler.Convert[T](Stream fileStream, String fileName, SaveOptions saveOptions)

@egormarkov,

We investigated your issues using 17.8.0 version of the API. The problematic PDF you shared earlier is encrypted by permission password, which means, it can be opened and viewed, but some restricted operations cannot be performed. So you need to set password during document loading as follows:

LoadOptions loadOptions = new LoadOptions {Password = "secret"};
// convert starting from page 2 and convert 2 pages
HtmlSaveOptions saveOptions = new HtmlSaveOptions();
var convertedDocumentStream = conversionHandler.Convert<Stream>("sample.docx", loadOptions, saveOptions);

This will resolve your issue (if you enter right password).
However, we’d recommend you to use latest version of the API. GroupDocs.Conversion for .NET 18.3.0 permits you to work with such encrypted documents. Code is as follows:

// Instantiating the conversion handler from custom common class
ConversionHandler conversionHandler = Common.getConversionHandler(); ;
// Convert and save converted HTML documents. 
// Returns the converted HTML documents as IO Stream.
var convertedDocumentStream = conversionHandler.Convert(Common.inputGUIDFile, new HtmlSaveOptions());
MemoryStream targetStream = new MemoryStream();
convertedDocumentStream.Save(targetStream);

You can clone our open-source example project from here. For further details visit this wiki.

Thanks for you answer.

Am I right that if we upgrade to 18.3.0 - we will not hit this issue with the same file and same codes (I mean I dont need to set any password while converting)?

@egormarkov,

Yes, you will not face this issue with the same file using the code we shared earlier in v18.3.0.

Hi

We have a problem with PDF file conversion for IE and Edge browsers. We have tried in v. 18.5.0.
I’m attaching here 2 screen shots (one from Chrome, another one from Edge) + also pdf file which have a problem. This PDF file was created by exporting from Word document. Please check if you got same result on your side.

Thanks.
PDF Display Chrome.PNG (78.9 KB)
PDF Display Edge.PNG (88.6 KB)
EasiShare n OneDrive Business.pdf (117.1 KB)

@egormarkov,

Do you mean that you are trying to convert PDF file into HTML and then trying to render the output HTML in both browsers?
Please elaborate your use-case.

Yes, exactly

@egormarkov,

We investigated this issue at our end and its been noticed that output (HTML) file is rendered in Google Chrome properly but not in Edge. And this is the same case at your end. Hence, we’ve logged this issue in our internal issue tracking system with ID:CONVERSIONNET-2569. As we have further updates on it, you shall be notified.

@atirtahir3
Any updates on the last problem?
ID:CONVERSIONNET-2569