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
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
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
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
asked Nov 9 at 11:00
Serge Larionoff
11
11
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
Nov 9 at 12:44
Oh indeed, just edited with a correction.
– Arnaud
Nov 9 at 13:02
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
Nov 9 at 13:41
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
Nov 9 at 13:43
See : stackoverflow.com/questions/17973970/…
– Arnaud
Nov 9 at 14:02
add a 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
Nov 9 at 12:44
Oh indeed, just edited with a correction.
– Arnaud
Nov 9 at 13:02
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
Nov 9 at 13:41
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
Nov 9 at 13:43
See : stackoverflow.com/questions/17973970/…
– Arnaud
Nov 9 at 14:02
add a 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
Nov 9 at 12:44
Oh indeed, just edited with a correction.
– Arnaud
Nov 9 at 13:02
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
Nov 9 at 13:41
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
Nov 9 at 13:43
See : stackoverflow.com/questions/17973970/…
– Arnaud
Nov 9 at 14:02
add a 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 Nov 9 at 13:01
answered Nov 9 at 11:29
Arnaud
13.3k21630
13.3k21630
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
Nov 9 at 12:44
Oh indeed, just edited with a correction.
– Arnaud
Nov 9 at 13:02
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
Nov 9 at 13:41
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
Nov 9 at 13:43
See : stackoverflow.com/questions/17973970/…
– Arnaud
Nov 9 at 14:02
add a 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
Nov 9 at 12:44
Oh indeed, just edited with a correction.
– Arnaud
Nov 9 at 13:02
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
Nov 9 at 13:41
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
Nov 9 at 13:43
See : stackoverflow.com/questions/17973970/…
– Arnaud
Nov 9 at 14:02
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
Nov 9 at 12:44
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
Nov 9 at 12:44
Oh indeed, just edited with a correction.
– Arnaud
Nov 9 at 13:02
Oh indeed, just edited with a correction.
– Arnaud
Nov 9 at 13:02
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
Nov 9 at 13:41
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
Nov 9 at 13:41
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
Nov 9 at 13:43
It seems that the iText jar that contains this class is not in the classpath at runtime.
– Arnaud
Nov 9 at 13:43
See : stackoverflow.com/questions/17973970/…
– Arnaud
Nov 9 at 14:02
See : stackoverflow.com/questions/17973970/…
– Arnaud
Nov 9 at 14:02
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
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
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Required, but never shown
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
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown