We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HTML export - When image and text divs are rendered one after the other, they are placed NEXT TO each other, instead of one AFTER the other.
import com.lowagie.text.Document; import com.lowagie.text.html.HtmlWriter; import com.lowagie.text.xml.SAXmyHandler; import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.OutputStream; import java.util.HashMap; import javax.xml.parsers.ParserConfigurationException; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import org.xml.sax.SAXException; public class Sandbox { private static final String XML = """ <?xml version="1.0" encoding="UTF-8" ?> <itext producer="iTextSharpXML"> <paragraph><image url="./my_image.png" plainwidth="400" plainheight="225"></image></paragraph> <paragraph>ABC</paragraph> <paragraph>DEF</paragraph> </itext> """; public static void main(String[] args) throws IOException, ParserConfigurationException, SAXException { OutputStream os = new FileOutputStream("output1.html"); ByteArrayOutputStream out = new ByteArrayOutputStream(); Document document = new Document(); HtmlWriter htmlWriter = HtmlWriter.getInstance(document, out); htmlWriter.setImagepath("./"); ByteArrayInputStream is = new ByteArrayInputStream(XML.getBytes("UTF-8")); //parsing XML report template SAXParser parser = SAXParserFactory.newInstance().newSAXParser(); parser.parse(is, new SAXmyHandler(document, new HashMap<>())); os.write(out.toByteArray()); } public static InputStream convertToInputStream(byte[] s) { if (s == null) return null; InputStream is = null; is = new java.io.ByteArrayInputStream(s); return is; } }
The image should appear above the text. Instead, it appears AFTER the text:
Maayan Bin Nun
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
HTML export - When image and text divs are rendered one after the other, they are placed NEXT TO each other, instead of one AFTER the other.
To Reproduce
Expected behavior
The image should appear above the text.
Instead, it appears AFTER the text:
System
Your real name
Maayan Bin Nun
The text was updated successfully, but these errors were encountered: