This has been asked here and here - but all the answers in both do not work (I've spent over an hour trying them all).
Part of the problem I think is the background needs to be set to white with an alpha of 0. That way, for programs or formats that don't support alpha, the color is white instead of black.
So my question is, how do I set a created BufferedImage to a background of all transparent white?
My code (sets it to non-transparent white):
image = new BufferedImage((sectPage.getPaperWidth().getValue() * dpi) / 1440,
(sectPage.getPaperHeight().getValue() * dpi) / 1440,
BufferedImage.TYPE_INT_ARGB);
// bugbug - https://stackoverflow.com/questions/321736/how-to-set-dpi-information-in-an-image
graphics = image.createGraphics();
graphics.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_ON);
graphics.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS, RenderingHints.VALUE_FRACTIONALMETRICS_ON);
graphics.setRenderingHint(RenderingHints.KEY_TEXT_ANTIALIASING, RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
graphics.setRenderingHint(RenderingHints.KEY_RENDERING, RenderingHints.VALUE_RENDER_QUALITY);
// bugbug - want all clear
graphics.setColor(new Color(255, 255, 255));
graphics.fillRect(0,0,(sectPage.getPaperWidth().getValue() * dpi) / 1440, (sectPage.getPaperHeight().getValue() * dpi) / 1440);
Also tried passing in a color with alpha set to 0 and setBackground(). Got a back background in both of those cases.