Free Support Forum - groupdocs.com

How to apply css to groupdoc conversion


#1

Hi Team,

I am using groupdoc conversion api for InputStream to Pdf conversion but not able to add css .
Please tell me how can we add css to converted pdf.

Many Thanks
Saras Kumar


#2

@saras1234,

Please tell, are you trying to convert a HTML file to PDF?


#3

Yes , I am trying to convert html to pdf and wants to add/apply css file for that pdf.


#4

@saras1234,

We are investigating this. Your investigation ticket ID is CONVERSIONJAVA-817. As there is any update, you’ll be notified.


#5

@saras1234,

In general if the HTML has image tags and/or <link type=“text/css” …/> they are automatically embedded. It will be helpful if you can provide an example HTML.


#6

Hi Team,

I want to use below code for InputStream to pdf conversion :

InputStream inputStream = new ByteArrayInputStream(data);
ConvertedDocument convertedDocument = conversionHandler.convert(inputStream, new PdfSaveOptions());
convertedDocument.save(“converted from byte array.pdf”);
inputStream.close();

Please tell me how to get conversionHandler object and what configuration needs to set to ConversionConfig object.
Please help to asap so that we can go with the licenced version.


#7

@saras1234,

Can you please further elaborate this?
What we understand is that you want to see how to instantiate ConversionConfig to set conversion configuration and how to create instance of ConversionHandler class to convert between different file formats, right?
If yes, please go through following resources:

Below are the configuration details.

ConversionConfig conversionConfig = new ConversionConfig();
conversionConfig.setStoragePath(storagePath);
conversionConfig.setOutputPath(outputPath); 
// Instantiating the conversion handler
ConversionHandler conversionHandler = new ConversionHandler(conversionConfig);

If you give us more details, we can assist you accordingly.