Free Support Forum - aspose.com

Gif to Pdf Issue

I am having an issue to convert gif document to pdf. The gif is seen ok but pdf is blank.

Attached documents with original gif and pdf for your reference.
TESTBATCH.zip (6.5 KB)

thanks
Kevin

@ksheng

Can you please share the working sample code reproducing the issue.

BufferedImage readImage = null;

        try {

            readImage = ImageIO.read(new File(data.getCachedFileName()));

            var h = readImage.getHeight();

            var w = readImage.getWidth();

            var doc = new Document();

            Page page = doc.getPages().add();

            com.aspose.pdf.Image image = new Image();

            image.setFile(data.getCachedFileName());

            page.getPageInfo().setHeight(h);

            page.getPageInfo().setWidth(w);

            page.getPageInfo().getMargin().setBottom(0);

            page.getPageInfo().getMargin().setTop(0);

            page.getPageInfo().getMargin().setRight(0);

            page.getPageInfo().getMargin().setLeft(0);

            page.getParagraphs().add(image);

            doc.save(outputPdfLocation());

        } catch (Exception e) {

            exceptionHandling(e, "image to Pdf ");

        }

@ksheng

This issue is related to Aspose.PDF and I am moving this thread to concerned forum where our respective support team will assist you further in this regard.

@ksheng

We were able to notice that the output PDF contains only black image in it while testing the scenario with Aspose.PDF for Java 21.3. Therefore, an issue as PDFJAVA-40301 has been logged in our issue tracking system for further investigation. We will look into its details and keep you posted with the status of its correction. Please be patient and spare us some time.

We are sorry for the inconvenience.

Hi @asad.ali I am anxious to know if there is any solution to this particular problem.

This is one tricky problem i am facing and i want to get this problem addressed asap if possible at all.

thanks,
Kevin

@ksheng

The concerned issue is blocked owing to internal API limitation. After investigation, an internal task has been added for rectifying the issue in Aspose.PDF for .NET and then later it shall be ported to Aspose.PDF for Java as well. We request for your patience in this regard till the time the issue gets resolved.

Thank you @mudassir.fayyaz

That’s a great news!