Hi There,
Hi Srini,
If you want to convert a TIFF (or other images) to a new PDF file, you can do that with the help of Aspose.Pdf for Java by using the following code snippet: Convert Images to PDF. Aspose.Pdf.Kit for Java allows you to add images in an existing PDF file only.
As far as converting a Word document to PDF/A compliant file is concerned, I’m afraid, this is currently not supported. You can only convert a Word document to a PDF document using Aspose.Words for Java. However, we have logged a new feature request to convert an existing PDF file to PDF/A compliant file, for Aspose.Pdf.Kit for Java, as PDFKITJAVA-28640 in our issue tracking system. You’ll be notified via this forum thread once it is supported in future.
We’re sorry for the inconvenience.
Regards,
Hi,
I have used the code snippet to convert TIF image as PDF(Java) it did work fine but I have never been able to show image color as it is because conversion is producing output as black and white, do you know how I can make it color?
Here is the Java code I am using.
License license = new License();
try {
license.setLicense(new FileInputStream("C:/Projects/ProtoTypes/PDF-Aspose/Aspose.Pdf.lic"));
} catch (Exception e2) {
e2.printStackTrace();
}
// Instantiate a Pdf object by calling its empty constructor
Pdf pdf1 = new Pdf();
// Create a section in the Pdf object
Section sec1 = pdf1.getSections().add();
// Create an image object in the section
Image img1 = new Image(sec1);
// Set the path of image file
img1.getImageInfo().setFile("C:/Projects/ProtoTypes/PDF-Aspose/ccm/conversion/doctopdf/desktop.tif");
// Set the path of image file
//img1.getImageInfo().setTitle(“TIF image”);
img1.getImageInfo().setImageFileType(ImageFileType.Tiff);
//img1.setImageScale(0.95F);
// Add image object into the Paragraphs collection of the section
sec1.getParagraphs().add(img1);
// Save the Pdf
FileOutputStream out = null;
try {
out = new FileOutputStream(new File("C:/Projects/ProtoTypes/PDF-Aspose/ccm/conversion/doctopdf/desktop.pdf"));
} catch (FileNotFoundException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
}
pdf1.save(out);
Your documentation shows I can convert Word document "Any document loaded into Aspose.Words can be converted to PDF that conforms to the PDF 1.5 or PDF/A-1b specification." - Can you please explain how i can do this? Converting to PDF/A-1b?
kanakams:
Your documentation shows I can convert Word document "Any document loaded into Aspose.Words can be converted to PDF that conforms to the PDF 1.5 or PDF/A-1b specification." - Can you please explain how i can do this? Converting to PDF/A-1b?
kanakams:
I have used the code snippet to convert TIF image as PDF(Java) it did work fine but i have never been able to show image color as it is because conversion is producing output as black and white, do you know how i can make it color?
Attached an image file i am trying to convert and as well output PDF file using the code snippet i gave you above.
Hello Srinivasa,
have tested the scenario and I am able to reproduce the same problem. For the
sake of correction, I have logged it in our issue tracking system as PDFNEWNET-32319. We
will investigate this issue in details and will keep you updated on the status
of a correction.
apologize for your inconvenience.
Hi Aspose Word team,
Your documentation shows I can convert Word document “Any document loaded into Aspose.Words can be converted to PDF that conforms to the PDF 1.5 or PDF/A-1b specification.” - Can you please explain how i can do this? Converting to PDF/A-1b?
Can you please give me details on how i can convert word document to PDF/A-1b?
Regards
Srini
Hi
Thanks for your request. Here is code that demonstrates how you can save a Word document as PDF/A-1b:
// Open input document.
Document doc = new Document("in.doc");
// Specify PDF compliance.
PdfSaveOptions opt = new PdfSaveOptions();
opt.setCompliance(PdfCompliance.PDF_A_1_B);
// Save document to PDF.
doc.save("out.pdf", opt);
Best regards,
Hi Aspose Team,
Thank you very much i am able to convert to PDF/A-1b.
Hi
It is perfect that you managed to convert your documents. Also please take a look at the following article:
It describes how you can convert images including TIFF to PDF using Aspose.Words.
Best regards,
I have used same exact piece of code to convert images to PDF but it didn't work for TIF image types.
Unfortunately it didn't recognize TIF as valid format and failed at following line.
ImageReader reader = ImageIO.getImageReaders(iis).next();
As Aspose Words for Java failed i tried to use PDF and it didn't do the job as well. I am attaching TIF file which need to be convered if you can let me know how i can convert it to PDF that would be great help.
Srini
Hi Srini,
Thank you for quick response.
Yes, i am able to convert TIF to PDF as well using Aspose PDF for Java. Like it happend to you i also got the output which is black and white.
If this is going to be a bug and will be fixed do you know does it take 3 months or 6 months because we need this feature to work for us but we need timeline on when this will be fixed.
Regards
Srini
Hello Srini,
Hi Srini,
Thanks for your inquiry.
Additionally the reason Aspose.Words was encountering that exception is because you must have the appropriate JAI reader installed to load the TIFF image format. You can download and install the latest version from here: http://java.net/projects/jai-imageio/
Thanks,
Hi Aspose Team,
Thank you very much for response, i am able to convert TIF to PDF using Aspose Word by including Java Image IO package.
Regards
Srini
Hi Srini,