How to translate correctly an iText5 code piece to an iText7?
up vote
0
down vote
favorite
I am an SQL/ETL(PowerCenter)/bash/Python developer with a very little experience in Java. I have a task - I need to take a .pptx template, customize it and convert to a .pdf file. I've decided to start from the second step, so I took this as an example. I've got latest versions of libraries (iText7 and POI4), so I had to modify this code in order to compile it. I was able to find moved packages in an Import part but then I stuck here:
slideImage = Image.getInstance(img, null);
My new libraries say that getInstance is not supported anymore (cannot find symbol). I'm trying to skip this step and use an analogue of
table.addCell(new PdfPCell(slideImage, true));
which I've changed to
table.addCell(new Cell(img, true));
to add this bufferedImage directly to a cell, it throws conversion errors, like "BufferedImage cannot be converted to int). How can I convert BufferedImage to Image? I read that the 1st is a child of the 2nd, so there's no need to convert it, but it doesn't work. Below I'm providing the code adjusted by me. Thank you in advance!
import java.io.FileOutputStream;
import java.io.*;
import java.io.IOException;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hslf.record.Slide;
import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFSlide;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Image;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.layout.element.Cell;
import com.itextpdf.layout.element.Table;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.geom.PageSize;
public void createPdf(String inFileName, String outFileName)
throws IOException
FileInputStream inputStream = new FileInputStream(inFileName);
double zoom = 2;
AffineTransform at = new AffineTransform();
at.setToScale(zoom, zoom);
Table table = new Table(1);
Dimension pgsize = null;
Image slideImage = null;
BufferedImage img = null;
XMLSlideShow ppt = new XMLSlideShow(inputStream);
pgsize = ppt.getPageSize();
// PDF part
// Initialize PDF writer
PdfWriter writer = new PdfWriter(outFileName);
// Initialize PDF document
PdfDocument pdf = new PdfDocument(writer);
// Initialize document
Rectangle srcPageSize = new Rectangle((float) pgsize.getWidth(), (float) pgsize.getHeight());
Document doc = new Document(pdf, new PageSize(srcPageSize));
List<XSLFSlide> slides = ppt.getSlides();
// writer.open();
// pdfDocument.open();
for (XSLFSlide slide : ppt.getSlides())
img = new BufferedImage((int) Math.ceil(pgsize.width * zoom), (int) Math.ceil(pgsize.height * zoom), BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = img.createGraphics();
graphics.setTransform(at);
graphics.setPaint(Color.white);
graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
slide.draw(graphics);
graphics.getPaint();
// Original start
// slideImage = Image.getInstance(img, null);
// table.addCell(new PdfPCell(slideImage, true));
// Original end
table.addCell(new Cell(img, true));
// pdfDocument.add(table);
// pdfDocument.close();
// pdfWriter.close();
System.out.println("Powerpoint file converted to PDF successfully");
// catch (IOException e)
//
// System.err.println("FileStreamsReadnWrite: " + e);
//
java itext7
New contributor
add a comment |
up vote
0
down vote
favorite
I am an SQL/ETL(PowerCenter)/bash/Python developer with a very little experience in Java. I have a task - I need to take a .pptx template, customize it and convert to a .pdf file. I've decided to start from the second step, so I took this as an example. I've got latest versions of libraries (iText7 and POI4), so I had to modify this code in order to compile it. I was able to find moved packages in an Import part but then I stuck here:
slideImage = Image.getInstance(img, null);
My new libraries say that getInstance is not supported anymore (cannot find symbol). I'm trying to skip this step and use an analogue of
table.addCell(new PdfPCell(slideImage, true));
which I've changed to
table.addCell(new Cell(img, true));
to add this bufferedImage directly to a cell, it throws conversion errors, like "BufferedImage cannot be converted to int). How can I convert BufferedImage to Image? I read that the 1st is a child of the 2nd, so there's no need to convert it, but it doesn't work. Below I'm providing the code adjusted by me. Thank you in advance!
import java.io.FileOutputStream;
import java.io.*;
import java.io.IOException;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hslf.record.Slide;
import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFSlide;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Image;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.layout.element.Cell;
import com.itextpdf.layout.element.Table;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.geom.PageSize;
public void createPdf(String inFileName, String outFileName)
throws IOException
FileInputStream inputStream = new FileInputStream(inFileName);
double zoom = 2;
AffineTransform at = new AffineTransform();
at.setToScale(zoom, zoom);
Table table = new Table(1);
Dimension pgsize = null;
Image slideImage = null;
BufferedImage img = null;
XMLSlideShow ppt = new XMLSlideShow(inputStream);
pgsize = ppt.getPageSize();
// PDF part
// Initialize PDF writer
PdfWriter writer = new PdfWriter(outFileName);
// Initialize PDF document
PdfDocument pdf = new PdfDocument(writer);
// Initialize document
Rectangle srcPageSize = new Rectangle((float) pgsize.getWidth(), (float) pgsize.getHeight());
Document doc = new Document(pdf, new PageSize(srcPageSize));
List<XSLFSlide> slides = ppt.getSlides();
// writer.open();
// pdfDocument.open();
for (XSLFSlide slide : ppt.getSlides())
img = new BufferedImage((int) Math.ceil(pgsize.width * zoom), (int) Math.ceil(pgsize.height * zoom), BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = img.createGraphics();
graphics.setTransform(at);
graphics.setPaint(Color.white);
graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
slide.draw(graphics);
graphics.getPaint();
// Original start
// slideImage = Image.getInstance(img, null);
// table.addCell(new PdfPCell(slideImage, true));
// Original end
table.addCell(new Cell(img, true));
// pdfDocument.add(table);
// pdfDocument.close();
// pdfWriter.close();
System.out.println("Powerpoint file converted to PDF successfully");
// catch (IOException e)
//
// System.err.println("FileStreamsReadnWrite: " + e);
//
java itext7
New contributor
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I am an SQL/ETL(PowerCenter)/bash/Python developer with a very little experience in Java. I have a task - I need to take a .pptx template, customize it and convert to a .pdf file. I've decided to start from the second step, so I took this as an example. I've got latest versions of libraries (iText7 and POI4), so I had to modify this code in order to compile it. I was able to find moved packages in an Import part but then I stuck here:
slideImage = Image.getInstance(img, null);
My new libraries say that getInstance is not supported anymore (cannot find symbol). I'm trying to skip this step and use an analogue of
table.addCell(new PdfPCell(slideImage, true));
which I've changed to
table.addCell(new Cell(img, true));
to add this bufferedImage directly to a cell, it throws conversion errors, like "BufferedImage cannot be converted to int). How can I convert BufferedImage to Image? I read that the 1st is a child of the 2nd, so there's no need to convert it, but it doesn't work. Below I'm providing the code adjusted by me. Thank you in advance!
import java.io.FileOutputStream;
import java.io.*;
import java.io.IOException;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hslf.record.Slide;
import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFSlide;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Image;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.layout.element.Cell;
import com.itextpdf.layout.element.Table;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.geom.PageSize;
public void createPdf(String inFileName, String outFileName)
throws IOException
FileInputStream inputStream = new FileInputStream(inFileName);
double zoom = 2;
AffineTransform at = new AffineTransform();
at.setToScale(zoom, zoom);
Table table = new Table(1);
Dimension pgsize = null;
Image slideImage = null;
BufferedImage img = null;
XMLSlideShow ppt = new XMLSlideShow(inputStream);
pgsize = ppt.getPageSize();
// PDF part
// Initialize PDF writer
PdfWriter writer = new PdfWriter(outFileName);
// Initialize PDF document
PdfDocument pdf = new PdfDocument(writer);
// Initialize document
Rectangle srcPageSize = new Rectangle((float) pgsize.getWidth(), (float) pgsize.getHeight());
Document doc = new Document(pdf, new PageSize(srcPageSize));
List<XSLFSlide> slides = ppt.getSlides();
// writer.open();
// pdfDocument.open();
for (XSLFSlide slide : ppt.getSlides())
img = new BufferedImage((int) Math.ceil(pgsize.width * zoom), (int) Math.ceil(pgsize.height * zoom), BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = img.createGraphics();
graphics.setTransform(at);
graphics.setPaint(Color.white);
graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
slide.draw(graphics);
graphics.getPaint();
// Original start
// slideImage = Image.getInstance(img, null);
// table.addCell(new PdfPCell(slideImage, true));
// Original end
table.addCell(new Cell(img, true));
// pdfDocument.add(table);
// pdfDocument.close();
// pdfWriter.close();
System.out.println("Powerpoint file converted to PDF successfully");
// catch (IOException e)
//
// System.err.println("FileStreamsReadnWrite: " + e);
//
java itext7
New contributor
I am an SQL/ETL(PowerCenter)/bash/Python developer with a very little experience in Java. I have a task - I need to take a .pptx template, customize it and convert to a .pdf file. I've decided to start from the second step, so I took this as an example. I've got latest versions of libraries (iText7 and POI4), so I had to modify this code in order to compile it. I was able to find moved packages in an Import part but then I stuck here:
slideImage = Image.getInstance(img, null);
My new libraries say that getInstance is not supported anymore (cannot find symbol). I'm trying to skip this step and use an analogue of
table.addCell(new PdfPCell(slideImage, true));
which I've changed to
table.addCell(new Cell(img, true));
to add this bufferedImage directly to a cell, it throws conversion errors, like "BufferedImage cannot be converted to int). How can I convert BufferedImage to Image? I read that the 1st is a child of the 2nd, so there's no need to convert it, but it doesn't work. Below I'm providing the code adjusted by me. Thank you in advance!
import java.io.FileOutputStream;
import java.io.*;
import java.io.IOException;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Graphics2D;
import java.awt.geom.AffineTransform;
import java.awt.geom.Rectangle2D;
import java.awt.image.BufferedImage;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import org.apache.poi.hslf.record.Slide;
import org.apache.poi.sl.usermodel.SlideShow;
import org.apache.poi.xslf.usermodel.XMLSlideShow;
import org.apache.poi.xslf.usermodel.XSLFSlide;
import com.itextpdf.layout.Document;
import com.itextpdf.layout.element.Image;
import com.itextpdf.kernel.geom.Rectangle;
import com.itextpdf.layout.element.Cell;
import com.itextpdf.layout.element.Table;
import com.itextpdf.kernel.pdf.PdfWriter;
import com.itextpdf.kernel.pdf.PdfDocument;
import com.itextpdf.kernel.geom.PageSize;
public void createPdf(String inFileName, String outFileName)
throws IOException
FileInputStream inputStream = new FileInputStream(inFileName);
double zoom = 2;
AffineTransform at = new AffineTransform();
at.setToScale(zoom, zoom);
Table table = new Table(1);
Dimension pgsize = null;
Image slideImage = null;
BufferedImage img = null;
XMLSlideShow ppt = new XMLSlideShow(inputStream);
pgsize = ppt.getPageSize();
// PDF part
// Initialize PDF writer
PdfWriter writer = new PdfWriter(outFileName);
// Initialize PDF document
PdfDocument pdf = new PdfDocument(writer);
// Initialize document
Rectangle srcPageSize = new Rectangle((float) pgsize.getWidth(), (float) pgsize.getHeight());
Document doc = new Document(pdf, new PageSize(srcPageSize));
List<XSLFSlide> slides = ppt.getSlides();
// writer.open();
// pdfDocument.open();
for (XSLFSlide slide : ppt.getSlides())
img = new BufferedImage((int) Math.ceil(pgsize.width * zoom), (int) Math.ceil(pgsize.height * zoom), BufferedImage.TYPE_INT_RGB);
Graphics2D graphics = img.createGraphics();
graphics.setTransform(at);
graphics.setPaint(Color.white);
graphics.fill(new Rectangle2D.Float(0, 0, pgsize.width, pgsize.height));
slide.draw(graphics);
graphics.getPaint();
// Original start
// slideImage = Image.getInstance(img, null);
// table.addCell(new PdfPCell(slideImage, true));
// Original end
table.addCell(new Cell(img, true));
// pdfDocument.add(table);
// pdfDocument.close();
// pdfWriter.close();
System.out.println("Powerpoint file converted to PDF successfully");
// catch (IOException e)
//
// System.err.println("FileStreamsReadnWrite: " + e);
//
java itext7
java itext7
New contributor
New contributor
New contributor
asked yesterday
Serge Larionoff
11
11
New contributor
New contributor
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
up vote
1
down vote
You may try the following , which uses the current API :
// you need to convert the BufferedImage to a byte array
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(img, "png", baos);
ImageData image = ImageDataFactory.create(baos.toByteArray());
table.addCell(new Image(image));
There are other interesting methods like ImageDataFactory.create(String filename)
.
Hi Arnaud! Thank you for an answer, i got the following compilation time error on the "Image image = ImageDataFactory.create(baos.toByteArray());" line - "incompatible types: ImageData cannot be converted to Image"
– Serge Larionoff
yesterday
Oh indeed, just edited with a correction.
– Arnaud
yesterday
Super, at least now it compiles successfully! After compilation I've started an execution and I got another error " [ERROR] Failed to load class [com.itextpdf.layout.element.Table] : [com.itextpdf.layout.element.Table]. [ERROR] java.lang.NoClassDefFoundError: com/itextpdf/layout/element/Table" I know that I do have this line in an import section. What could went wrong this time? Does this mean that a file with that class is not accessible on server? But I see that the folder with .jar files is listed in a $CLASSPATH.
– Serge Larionoff
yesterday
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
yesterday
Aha, should it contain exact file names or a parent folder name is enough? Because parent folder is already in a CLASSPATH
– Serge Larionoff
yesterday
|
show 1 more comment
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
1
down vote
You may try the following , which uses the current API :
// you need to convert the BufferedImage to a byte array
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(img, "png", baos);
ImageData image = ImageDataFactory.create(baos.toByteArray());
table.addCell(new Image(image));
There are other interesting methods like ImageDataFactory.create(String filename)
.
Hi Arnaud! Thank you for an answer, i got the following compilation time error on the "Image image = ImageDataFactory.create(baos.toByteArray());" line - "incompatible types: ImageData cannot be converted to Image"
– Serge Larionoff
yesterday
Oh indeed, just edited with a correction.
– Arnaud
yesterday
Super, at least now it compiles successfully! After compilation I've started an execution and I got another error " [ERROR] Failed to load class [com.itextpdf.layout.element.Table] : [com.itextpdf.layout.element.Table]. [ERROR] java.lang.NoClassDefFoundError: com/itextpdf/layout/element/Table" I know that I do have this line in an import section. What could went wrong this time? Does this mean that a file with that class is not accessible on server? But I see that the folder with .jar files is listed in a $CLASSPATH.
– Serge Larionoff
yesterday
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
yesterday
Aha, should it contain exact file names or a parent folder name is enough? Because parent folder is already in a CLASSPATH
– Serge Larionoff
yesterday
|
show 1 more comment
up vote
1
down vote
You may try the following , which uses the current API :
// you need to convert the BufferedImage to a byte array
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(img, "png", baos);
ImageData image = ImageDataFactory.create(baos.toByteArray());
table.addCell(new Image(image));
There are other interesting methods like ImageDataFactory.create(String filename)
.
Hi Arnaud! Thank you for an answer, i got the following compilation time error on the "Image image = ImageDataFactory.create(baos.toByteArray());" line - "incompatible types: ImageData cannot be converted to Image"
– Serge Larionoff
yesterday
Oh indeed, just edited with a correction.
– Arnaud
yesterday
Super, at least now it compiles successfully! After compilation I've started an execution and I got another error " [ERROR] Failed to load class [com.itextpdf.layout.element.Table] : [com.itextpdf.layout.element.Table]. [ERROR] java.lang.NoClassDefFoundError: com/itextpdf/layout/element/Table" I know that I do have this line in an import section. What could went wrong this time? Does this mean that a file with that class is not accessible on server? But I see that the folder with .jar files is listed in a $CLASSPATH.
– Serge Larionoff
yesterday
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
yesterday
Aha, should it contain exact file names or a parent folder name is enough? Because parent folder is already in a CLASSPATH
– Serge Larionoff
yesterday
|
show 1 more comment
up vote
1
down vote
up vote
1
down vote
You may try the following , which uses the current API :
// you need to convert the BufferedImage to a byte array
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(img, "png", baos);
ImageData image = ImageDataFactory.create(baos.toByteArray());
table.addCell(new Image(image));
There are other interesting methods like ImageDataFactory.create(String filename)
.
You may try the following , which uses the current API :
// you need to convert the BufferedImage to a byte array
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ImageIO.write(img, "png", baos);
ImageData image = ImageDataFactory.create(baos.toByteArray());
table.addCell(new Image(image));
There are other interesting methods like ImageDataFactory.create(String filename)
.
edited yesterday
answered yesterday
Arnaud
13.1k21529
13.1k21529
Hi Arnaud! Thank you for an answer, i got the following compilation time error on the "Image image = ImageDataFactory.create(baos.toByteArray());" line - "incompatible types: ImageData cannot be converted to Image"
– Serge Larionoff
yesterday
Oh indeed, just edited with a correction.
– Arnaud
yesterday
Super, at least now it compiles successfully! After compilation I've started an execution and I got another error " [ERROR] Failed to load class [com.itextpdf.layout.element.Table] : [com.itextpdf.layout.element.Table]. [ERROR] java.lang.NoClassDefFoundError: com/itextpdf/layout/element/Table" I know that I do have this line in an import section. What could went wrong this time? Does this mean that a file with that class is not accessible on server? But I see that the folder with .jar files is listed in a $CLASSPATH.
– Serge Larionoff
yesterday
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
yesterday
Aha, should it contain exact file names or a parent folder name is enough? Because parent folder is already in a CLASSPATH
– Serge Larionoff
yesterday
|
show 1 more comment
Hi Arnaud! Thank you for an answer, i got the following compilation time error on the "Image image = ImageDataFactory.create(baos.toByteArray());" line - "incompatible types: ImageData cannot be converted to Image"
– Serge Larionoff
yesterday
Oh indeed, just edited with a correction.
– Arnaud
yesterday
Super, at least now it compiles successfully! After compilation I've started an execution and I got another error " [ERROR] Failed to load class [com.itextpdf.layout.element.Table] : [com.itextpdf.layout.element.Table]. [ERROR] java.lang.NoClassDefFoundError: com/itextpdf/layout/element/Table" I know that I do have this line in an import section. What could went wrong this time? Does this mean that a file with that class is not accessible on server? But I see that the folder with .jar files is listed in a $CLASSPATH.
– Serge Larionoff
yesterday
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
yesterday
Aha, should it contain exact file names or a parent folder name is enough? Because parent folder is already in a CLASSPATH
– Serge Larionoff
yesterday
Hi Arnaud! Thank you for an answer, i got the following compilation time error on the "Image image = ImageDataFactory.create(baos.toByteArray());" line - "incompatible types: ImageData cannot be converted to Image"
– Serge Larionoff
yesterday
Hi Arnaud! Thank you for an answer, i got the following compilation time error on the "Image image = ImageDataFactory.create(baos.toByteArray());" line - "incompatible types: ImageData cannot be converted to Image"
– Serge Larionoff
yesterday
Oh indeed, just edited with a correction.
– Arnaud
yesterday
Oh indeed, just edited with a correction.
– Arnaud
yesterday
Super, at least now it compiles successfully! After compilation I've started an execution and I got another error " [ERROR] Failed to load class [com.itextpdf.layout.element.Table] : [com.itextpdf.layout.element.Table]. [ERROR] java.lang.NoClassDefFoundError: com/itextpdf/layout/element/Table" I know that I do have this line in an import section. What could went wrong this time? Does this mean that a file with that class is not accessible on server? But I see that the folder with .jar files is listed in a $CLASSPATH.
– Serge Larionoff
yesterday
Super, at least now it compiles successfully! After compilation I've started an execution and I got another error " [ERROR] Failed to load class [com.itextpdf.layout.element.Table] : [com.itextpdf.layout.element.Table]. [ERROR] java.lang.NoClassDefFoundError: com/itextpdf/layout/element/Table" I know that I do have this line in an import section. What could went wrong this time? Does this mean that a file with that class is not accessible on server? But I see that the folder with .jar files is listed in a $CLASSPATH.
– Serge Larionoff
yesterday
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
yesterday
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
yesterday
Aha, should it contain exact file names or a parent folder name is enough? Because parent folder is already in a CLASSPATH
– Serge Larionoff
yesterday
Aha, should it contain exact file names or a parent folder name is enough? Because parent folder is already in a CLASSPATH
– Serge Larionoff
yesterday
|
show 1 more comment
Serge Larionoff is a new contributor. Be nice, and check out our Code of Conduct.
Serge Larionoff is a new contributor. Be nice, and check out our Code of Conduct.
Serge Larionoff is a new contributor. Be nice, and check out our Code of Conduct.
Serge Larionoff is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53224457%2fhow-to-translate-correctly-an-itext5-code-piece-to-an-itext7%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password