Inverted colors when printing to PDF on iOS
Posted: Tue May 05, 2015 3:41 am
Okay, this is a ridiculously vexing one for me. I'd appreciate any advice you might be able to provide.
In the process of using the app, the user can create a drawing. At a later point in the app, the user can compile the drawings to a PDF. This is working fine except for one small problem.
The drawings have a white background, a black silhouette, and different colored lines on top of the black. These drawings are saved as expected. I verified this in the simulator, by digging into the directories. So far, all is well.
But the problem comes when I print to PDF.
When I do that, the image gets compiled to the PDF. And in those images, the white appears as white, the black appears as black, but the colors are inverted. I've attached an image that demonstrates what I'm seeing. Another thing I've noticed is that the image has a black border, even though I've specified it not to show the border.
And here's my code.
I'd appreciate it if you could tell me what I've done wrong.
Thanks so much.
joel
In the process of using the app, the user can create a drawing. At a later point in the app, the user can compile the drawings to a PDF. This is working fine except for one small problem.
The drawings have a white background, a black silhouette, and different colored lines on top of the black. These drawings are saved as expected. I verified this in the simulator, by digging into the directories. So far, all is well.
But the problem comes when I print to PDF.
When I do that, the image gets compiled to the PDF. And in those images, the white appears as white, the black appears as black, but the colors are inverted. I've attached an image that demonstrates what I'm seeing. Another thing I've noticed is that the image has a black border, even though I've specified it not to show the border.
And here's my code.
Code: Select all
on mouseUp
answer "Please tap OK and then wait while report is compiled"
lock screen
put number of lines of field "customDates" into tHowMany
repeat with i=1 to tHowMany
clone card "templateCard"
set the name of this card to "Diary - " & i
put line i of field "customDates" of card "PainCalendar" into tLine
put replaceText(tLine,"/","-") into tLine
put replaceText(tLine,tab,"-") into tLine
put tLine&"Small.jpg" into tPix
put tLine&".txt" into tTxt
put specialfolderpath("documents")&"/"&tTxt into tTxt
put url ("file:" & tTxt) into tTxt
put line 1 of tTxt into word 3 of field "cardTitle"
put line 2 of tTxt into field "startTime"
put line 3 of tTxt into field "endTime"
put line 4 of tTxt into field "notesField"
set the filename of image "smallSilhouette" to specialfolderpath("documents")&"/"&tPix
set the angle of image "smallSilhouette" to 90
set the rect of image "smallSilhouette" to "0,0,300,600"
end repeat
put specialFolderPath("documents") & "/MyPainDiary.pdf" into tPDFPath
open printing to pdf tPDFPath
if the result is "Cancel" then
exit mouseUp
else
repeat with i=1 to tHowMany
put "Diary - " & i into tCard
print card tCard of this stack into 0,0,550,367
print break
end repeat
end if
close printing
repeat with i=1 to tHowMany
delete card ("Diary - " & i)
end repeat
unlock screen
visual effect scroll left very fast
go card "report"
end mouseUp
Thanks so much.
joel