I don't want to learn testcomplete, but assuming this is about
converting PDFs to images, see here:
https://stackoverflow.com/questions/23326562/apache-pdfbox-convert-pdf-to-images/23327024#23327024
So what you have to do is to change these lines into your language:
|newPDFRenderer(document); ||BufferedImagebim
=pdfRenderer.renderImageWithDPI(page,300,ImageType.RGB);|
||
so the first line would probably be
var pdfRenderer =
JavaClasses.org.apache.pdfbox.rendering.PDFRenderer.newInstance(fileName);
Tilman
Am 15.10.2019 um 18:42 schrieb Evan Stansel:
function convertPageToPicture(docObj, pageIndex, fileName)
{
var pageObj, imgBuffer, imgFile, imgFormat, pictureObj;
// Get the desired page
pageObj = getPage(docObj, pageIndex);
// Convert the page to image data
imgBuffer = pageObj.convertToImage();
// Create a new file to save
imgFile = JavaClasses.java_io.File.newInstance(fileName);
// Get the image format from the name
imgFormat = aqString.SubString(fileName, aqString.GetLength(fileName)-3, 3);
// Save the image to the created file
JavaClasses.javax_imageio.ImageIO.write(imgBuffer, imgFormat, imgFile);
// Create a Picture object
pictureObj = Utils.Picture;
// Load the image as a picture
pictureObj.LoadFromFile(fileName);
// Return the picture object
return pictureObj;
}