Rotieren von SVGOMDocument (Batik)

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • Rotieren von SVGOMDocument (Batik)

    Ich habe ein Problem. Möglicherweise ist es ganz simpel, aber ich komme einfach nicht dahinter. Ich habe ein SVGOMDocument (doc), welches ich in ein jpg transcoden will. Die folgende Methode arbeitet ohne Probleme. Ich würde aber gerne ein um 90° gedrehtes jpg bekommen. Ich weiss aber nicht, wie ich das anstellen kann.

    Quellcode

    1. public InputStream getJPG()
    2. {
    3. // Create a JPEGTranscoder and set its quality hint.
    4. JPEGTranscoder F_transcode = new JPEGTranscoder();
    5. F_transcode.addTranscodingHint(JPEGTranscoder.KEY_QUALITY,
    6. new Float(1));
    7. F_transcode.addTranscodingHint(JPEGTranscoder.KEY_WIDTH, new Float(1000));
    8. TranscoderOutput F_output = null;
    9. ByteArrayInputStream F_istream = null;
    10. try
    11. {
    12. // Set the transcoder input and output.
    13. TranscoderInput F_input = new TranscoderInput(doc);
    14. ByteArrayOutputStream F_ostream = new ByteArrayOutputStream();
    15. F_output = new TranscoderOutput(F_ostream);
    16. // Perform the transcoding.
    17. F_transcode.transcode(F_input, F_output);
    18. F_ostream.flush();
    19. F_ostream.close();
    20. F_istream = new ByteArrayInputStream(F_ostream.toByteArray());
    21. }
    22. catch (FileNotFoundException P_ex)
    23. {
    24. DBC.INTERIM.fail(P_ex);
    25. }
    26. catch (TranscoderException P_ex)
    27. {
    28. DBC.INTERIM.fail(P_ex);
    29. }
    30. catch (IOException P_ex)
    31. {
    32. DBC.INTERIM.fail(P_ex);
    33. }
    34. return F_istream;
    35. }
    Alles anzeigen