Table-cell error converting HTML to PDF

@funassettc,

Thanks for contacting support.

I have observed your comments. Can you please share source file along with sample code so that we may further investigate to help you out.

Hello,
4 years later, I discover the same error message (and we use Aspose):
eb4c10fd97894e10dc2e3b0e6253afbc.png (143,5 Ko)

Would it be possible to have your help on this please?

Many thanks

@cdubien

Can you please share the information requested above so that we can further proceed accordingly.

Hello @asad.ali, here attached the .htm file into this .zip which have this issue :

MF-00065993.zip (10,7 Ko)

Many thanks for your help !

@cdubien

We tested using 24.3 version in our environment and could not see any error. Attached is the code snippet and generated file for your kind reference.

string html = File.ReadAllText(dataDir + "MF-00065993_0-2024-03-20 09 21 19.htm");

var byteArray = Encoding.UTF8.GetBytes(html);
using var inStream = new MemoryStream(byteArray);

var options = new HtmlLoadOptions
{
    // set Print or Screen mode
    HtmlMediaType = HtmlMediaType.Print,
    IsEmbedFonts = true,
    IsRenderToSinglePage = true
};

using var document = new Document(inStream, options);

document.Save(dataDir + "tst.pdf");

tst.pdf (548.8 KB)

Hello,
Unfortunately, regarding his issue on our side, it seems the .htm cannot be rendered but sometimes it’s possible. Could it be related to a specific version of Aspose? We don’t have Aspose 24.3, but 20.7. What can we check to move forward on this?

Many thanks,

Best regards,
Christophe

@cdubien

Yes, it can be related to the older version. You can obtain a 30-days temporary license in order to evaluate 24.3 version of the API and once you are satisfied that issue is no longer happening, you can upgrade your license.

Hello Asad,

Unfortunately, the product we use with Aspose, Documentum Content Transformation Services is not yet compatible with Aspose 23.4.
The question is, regarding the issue, it could be a 100% issue related to Aspose? And if it is, did you had this issue before? There is a workaround?

Many thanks,

Best regards,
Christophe

@cdubien

Every issue can be one of its own kind because PDF format is so dynamic. Even two identical document can differ from one another in terms of their structure. Therefore, we cannot say for sure if we have resolved similar issue before. However, it is evident that the latest version is not creating the issue and we can only comment further or continue our investigation if issue is present in the latest version which is not a case.

We are afraid that we cannot offer any workaround and only option we can give you is to upgrade to the latest version. Please feel free to let us know in case you need further information.

Hello Asad, would it be possible to share it the tst.pdf file? It seems it’s indicated as private but a colleague from Eng would like to check it please.

The code you shared is in .NET, can you please share this code in Java?

Many thanks !

@cdubien

Here is the equivalent code for Java:

import com.aspose.pdf.Document;
import com.aspose.pdf.HtmlLoadOptions;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.InputStream;

public class HtmlToPdfConversion {
    public static void main(String[] args) {
        String dataDir = "your_data_directory/";

        try {
            String html = new String(Files.readAllBytes(Paths.get(dataDir + "MF-00065993_0-2024-03-20 09 21 19.htm")));

            byte[] byteArray = html.getBytes("UTF-8");
            ByteArrayInputStream inStream = new ByteArrayInputStream(byteArray);

            HtmlLoadOptions options = new HtmlLoadOptions();
            options.setHtmlMediaType(HtmlMediaType.Print);
            options.setEmbedFonts(true);
            options.setRenderToSinglePage(true);

            Document document = new Document(inStream, options);

            document.save(dataDir + "tst.pdf");
        } catch (Exception ex) {
            System.out.println(ex.getMessage());
        }
    }
}

The file link that you requested is here.

Hi @asad.ali and thanks !
My colleague from engineering tried with the above code only as a standalone program, using Aspose pdf 24.3 and he still have the issue.

Would it be possible to schedule a call regarding this, there is a possibility to talk with you on that?

Many thanks !

@cdubien

We are afraid that we cannot provide support over call because of the free support policies. You are encouraged to share your sample files and the code snippet with us here and we will try our best to assist you accordingly.

Hi @asad.ali,

if I share a recording, it could be OK?

Many thanks !

@cdubien

Yeah sure. That would do.

@funassettc

Thanks for sharing the screen recording in a private message. We were able to replicate the issue in our environment now. We have opened the following new ticket(s) in our internal issue tracking system and will deliver their fixes according to the terms mentioned in Free Support Policies.

Issue ID(s): PDFJAVA-43872

You can obtain Paid Support Services if you need support on a priority basis, along with the direct access to our Paid Support management team.

Hello Asad,

thanks, this is a good news ! I have a question please, regarding the fix, would it be possible to do it for Aspose 20.7, the version used by the customer or it will be fixed for a future version of Aspose?

Many thanks,

Best regards,
Christophe Dubien

@cdubien

We provide support on the basis of the newest and latest version of the API because every issue is fixed in the higher/latest version. Fixes are not provided in older versions. Therefore, whenever the issue is resolved, its fix will be shipped with the latest version of the API at that time.

Hi Asad, OK understood. So basically there are no workaround to avoid this kind of issue, we need to wait a future version of Aspose to resolve it?

Many thanks,

best regards,
Christophe Dubien

@cdubien

Yes, your understanding is correct. We will notify you as soon as the ticket is resolved. Please spare us some time. We apologize for the inconvenience.