sample_640×426.zip (666.2 KB)
Aspose Team,
We tried to use the Aspose PDF java package to convert PICT file to PDF, and found out that the result PDF file is blank.
Following is the sample code and attached is the the sample file
The operating system is Ubuntu 20.04. Java version is 11. Aspose PDF java packages is 23.2.
import com.aspose.pdf.Document;
import com.aspose.pdf.Image;
import com.aspose.pdf.Page;
public class ConvertPictToPdf_23 {
public static void main(String[] args) {
Document pdfDocument = null;
try {
new com.aspose.pdf.License().setLicense(“path-to-license-file”);
String inputFilePath = “path-to-pict-file”;
String outputFilePath = inputFilePath + “.pdf”;
pdfDocument = new Document();
Page page = pdfDocument.getPages().add();
Image pdfImage = new Image();
pdfImage.setFile(inputFilePath);
pdfImage.setInNewPage(true);
page.getParagraphs().add(pdfImage);
pdfDocument.save(outputFilePath);
} catch (Exception ex) {
ex.printStackTrace();
} finally {
if (pdfDocument != null) {
pdfDocument.close();
}
}
}
}