File tree Expand file tree Collapse file tree
pdf/src/main/java/com/kylecorry/andromeda/pdf Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import com.vanniktech.maven.publish.AndroidSingleVariantLibrary
22
3- val versionName = " 16.0.0-beta01 "
3+ val versionName = " 16.0.0"
44val groupId = " com.kylecorry.andromeda"
55
66buildscript {
Original file line number Diff line number Diff line change 11package com.kylecorry.andromeda.pdf
22
3+ import java.io.ByteArrayOutputStream
4+
35sealed interface PDFValue {
46
57 fun toByteArray (): ByteArray {
@@ -49,6 +51,17 @@ sealed interface PDFValue {
4951 content.joinToString(separator = " \n " ) +
5052 " \n endobj"
5153 }
54+
55+ override fun toByteArray (): ByteArray {
56+ val bytes = ByteArrayOutputStream ()
57+ bytes.write(" $id $generation obj\n " .toByteArray())
58+ for (value in content) {
59+ bytes.write(value.toByteArray())
60+ bytes.write(" \n " .toByteArray())
61+ }
62+ bytes.write(" endobj\n " .toByteArray())
63+ return bytes.toByteArray()
64+ }
5265 }
5366
5467 class PDFStream (val content : ByteArray ) : PDFValue {
You can’t perform that action at this time.
0 commit comments