@@ -5,6 +5,7 @@ import androidx.compose.runtime.State
55import androidx.compose.runtime.mutableStateOf
66import com.groupdocs.comparison.Comparer
77import com.groupdocs.comparison.Document
8+ import com.groupdocs.comparison.common.function.CreatePageStreamFunction
89import com.groupdocs.comparison.license.License
910import com.groupdocs.comparison.options.CompareOptions
1011import com.groupdocs.comparison.options.PreviewOptions
@@ -35,7 +36,7 @@ class ResultViewModel(private val screen: MutableState<Screen>) {
3536 val sourcePath: String
3637 val targetPath: String
3738 val targetName: String
38- tempDir = Paths .get(System .getenv( " TMP " ))
39+ tempDir = Paths .get(System .getProperty( " java.io.tmpdir " ))
3940 if (screen.value is Screen .Result ) {
4041 sourcePath = (screen.value as Screen .Result ).source
4142 targetPath = (screen.value as Screen .Result ).target
@@ -89,11 +90,11 @@ class ResultViewModel(private val screen: MutableState<Screen>) {
8990 CoroutineScope (Dispatchers .IO ).launch {
9091 try {
9192 val result = Document (resultPath)
92- result.generatePreview(PreviewOptions {
93+ result.generatePreview(PreviewOptions ( CreatePageStreamFunction {
9394 val pagePath = tempDir.resolve(" gd_${System .currentTimeMillis()} _page_$it .png" )
9495 pageList.add(pagePath.toString())
9596 FileOutputStream (pagePath.toFile())
96- }.apply {
97+ }) .apply {
9798 previewFormat = PreviewFormats .PNG
9899 })
99100 } catch (e: Exception ) {
0 commit comments