<div dir="ltr">The tile rendering exception was caused by this path:<div><br></div><div><div>







<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)">OUString VclBuilderContainer::getUIRootDir()</p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)">{</p>
<p class="gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(228,67,71);background-color:rgb(40,43,53)"><span class="gmail-s1" style="color:rgb(255,255,255)"><span class="gmail-Apple-converted-space">    </span>OUString sShareLayer(</span>"$BRAND_BASE_DIR/$BRAND_SHARE_SUBDIR/config/soffice.cfg/"<span class="gmail-s1" style="color:rgb(255,255,255)">);</span></p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-Apple-converted-space">    </span>rtl::Bootstrap::expandMacros(sShareLayer);</p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-Apple-converted-space">    </span><span class="gmail-s2" style="color:rgb(194,52,155)">return</span> sShareLayer;</p>
<p class="gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)">}</p></div><div class="gmail_extra"><br></div><div class="gmail_extra">In my build <span style="background-color:rgb(40,43,53);color:rgb(228,67,71);font-family:Menlo;font-size:11px">$BRAND_SHARE_SUBDIR</span></div><div class="gmail_extra">was not defined.</div><div class="gmail_extra">Manually adding <span style="background-color:rgb(40,43,53);color:rgb(255,255,255);font-family:Menlo;font-size:11px">BRAND_SHARE_SUBDIR=share</span></div>







<div class="gmail_extra">to fundamentalrc allowed me to render a tile using the CGContext based code in the unit test, and save it to a png. Woohoo!</div><div class="gmail_extra"><br></div><div class="gmail_extra">I'm not sure where that should be added?</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Jan 1, 2018 at 9:44 PM, Jon Nermut <span dir="ltr"><<a href="mailto:jon.nermut@gmail.com" target="_blank">jon.nermut@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Well a framework is effectively dylib *in a bundle*. For swift there is some special module stuff baked in too. So I also moved all the resources to the framework (hence the changes I made to look up the framework bundle instead of the main bundle to find the rc / unorc etc files. <div><br><div>You're probably right that you should be able to spit out a dylib or a framework from ld - I've just spent *way* too much of my professional life fighting xcode on this kind of stuff that I'll always go with what the IDE says. Which these days is frameworks. But if you can get the .mk to produce a dylib and be able to use it the dev process will be better whether you use a framework to encapsulate the library or not.</div></div><div><br></div><div>Does the dylib load at all on the device? Or does it give image not found error, or symbol not found? It's very sensitve to paths - both where the dylib is in the bundle (if you put it in the embed section it will be under /Frameworks/), and the runtime search path setting, which needs to include that location.</div><div><br></div><div>NB our app which has an embedded framework wrapping the pdfium lib, has been in the appstore with that framework for at least a year.</div><span class="gmail-"><div><br></div><div>> <span style="font-size:12.8px">My problem was more how to use the returned array in order to render it effectively</span></div><div><span style="font-size:12.8px"><br></span></div></span><div><span style="font-size:12.8px">So that was using the paintTile function? What did you pass into it - a CGContextRef or a byte array? </span>Or is paintTile the wrong function to be calling entirely??</div><div><span style="font-size:12.8px">If a CGContextRef (which is what it has to be, given this)</span></div><div><span style="font-size:12.8px"><br></span></div><div>







<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(210,143,90);background-color:rgb(40,43,53)"><br></p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">static</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">void</span> doc_paintTile(<wbr>LibreOfficeKitDocument* pThis,</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">unsigned</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">char</span>* pBuffer,</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">const</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">int</span> nCanvasWidth, <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">const</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">int</span> nCanvasHeight,</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">const</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">int</span> nTilePosX, <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">const</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">int</span> nTilePosY,</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">const</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">int</span> nTileWidth, <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">const</span> <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">int</span> nTileHeight)</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(210,143,90);background-color:rgb(40,43,53)">












</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)">{</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(210,143,90);background-color:rgb(40,43,53)">...</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(210,143,90);background-color:rgb(40,43,53)"><br></p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(210,143,90);background-color:rgb(40,43,53)">#if defined(IOS)</p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">    </span>SystemGraphicsData aData;</p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">    </span>aData.rCGContext = <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">reinterpret_cast</span><CGContextRef><wbr>(pBuffer);</p>
<p class="gmail-m_-2989294355240401758gmail-p3" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(77,191,86);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(255,255,255)">    </span>// the Size argument is irrelevant, I hope</p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">    </span>ScopedVclPtrInstance<<wbr>VirtualDevice> pDevice(&aData, Size(<span class="gmail-m_-2989294355240401758gmail-s3" style="color:rgb(139,132,207)">1</span>, <span class="gmail-m_-2989294355240401758gmail-s3" style="color:rgb(139,132,207)">1</span>), DeviceFormat::DEFAULT);</p>
<p class="gmail-m_-2989294355240401758gmail-p4" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:12px;line-height:normal;font-family:Helvetica;background-color:rgb(40,43,53);min-height:14px"><br></p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">    </span>pDoc->paintTile(*pDevice.get()<wbr>, nCanvasWidth, nCanvasHeight,</p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                    </span>nTilePosX, nTilePosY, nTileWidth, nTileHeight);</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(210,143,90);background-color:rgb(40,43,53)">#else</p></div><div class="gmail_extra"><br><div class="gmail_quote">then the overall way to get a UIImage is as per the POC code in DocumentController - set up a Image CGContext, do the render, then call <span style="background-color:rgb(40,43,53);color:rgb(0,175,202);font-family:Menlo;font-size:11px">UIGraphicsGetImageFromCur<wbr>rentImageContext</span></div><div class="gmail_quote"><br></div><div class="gmail_quote">







<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">            </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(0,175,202)">UIGraphicsBeginImageContextW<wbr>ithOptions</span>(<span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(0,175,202)">CGSize</span>(width: canvasWidth, height: canvasHeight), <span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(194,52,155)">false</span>, <span class="gmail-m_-2989294355240401758gmail-s3" style="color:rgb(139,132,207)">1.0</span>)</p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53);min-height:13px"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">            </span></p>
<p class="gmail-m_-2989294355240401758gmail-p3" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,175,202);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">            </span><span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(194,52,155)">let</span><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)"> ctx = </span>UIGraphicsGetCurrentContext<span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">()</span></p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">            </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(0,175,202)">print</span>(<span class="gmail-m_-2989294355240401758gmail-s5" style="text-decoration:underline">ctx</span>)</p>
<p class="gmail-m_-2989294355240401758gmail-p3" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,175,202);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">            </span><span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(194,52,155)">let</span><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)"> ptr = </span>unsafeBitCast<span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">(ctx, to: </span>UnsafeMutablePointer<span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)"><</span>UInt8<span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">>.</span><span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(194,52,155)">se<wbr>lf</span><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">)</span></p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">            </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(0,175,202)">print</span>(ptr)</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">            </span>doc.paintTile(pBuffer:ptr,</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span>canvasWidth: <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(0,175,202)">Int32</span>(canvasWidth),</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span>canvasHeight: <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(0,175,202)">Int32</span>(canvasHeight),</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span>tilePosX: tilePosX,</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span>tilePosY: tilePosY,</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span>tileWidth: tileWidth,</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">                          </span>tileHeight: tileHeight)</p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53);min-height:13px"><span class="gmail-m_-2989294355240401758gmail-Apple-converted-space">            </span></p>
<p class="gmail-m_-2989294355240401758gmail-p3" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,175,202);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">            </span><span class="gmail-m_-2989294355240401758gmail-s6" style="text-decoration:underline;color:rgb(194,52,155)">let</span><span class="gmail-m_-2989294355240401758gmail-s7" style="text-decoration:underline;color:rgb(255,255,255)"> image</span><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)"> = </span>UIGraphicsGetImageFromCurrentI<wbr>mageContext<span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">()</span></p>
<p class="gmail-m_-2989294355240401758gmail-p3" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,175,202);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">            </span>UIGraphicsEndImageContext<span class="gmail-m_-2989294355240401758gmail-s4" style="color:rgb(255,255,255)">()</span></p></div><div class="gmail_quote"><br></div><div class="gmail_quote">The unsafeBitCast in there is really just the reverse, (and just as horriable) of the reinterpret_cast in doc_paintTile</div><div class="gmail_quote"><br></div><div class="gmail_quote">Once you have a UIImage you can blat it to the screen in a UIImageView, or save it to disk etc.</div><div class="gmail_quote">>From memory to get a UIImage from a byte array you have to go via CGImage<br></div><div class="gmail_quote"><br></div><div class="gmail_quote">This is some sample code that goes from a byte buffer to a CGImage, then to a UIImage</div><div class="gmail_quote"><br></div><div class="gmail_quote">







<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> buffer = FPDFBitmap_GetBuffer(bitmap)</p>
<p class="gmail-m_-2989294355240401758gmail-p2" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53);min-height:13px"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span></p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> bitsPerComponent = <span class="gmail-m_-2989294355240401758gmail-s3" style="color:rgb(139,132,207)">8</span></p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> bitsPerPixel = <span class="gmail-m_-2989294355240401758gmail-s3" style="color:rgb(139,132,207)">32</span></p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> bytesPerRow = <span class="gmail-m_-2989294355240401758gmail-s3" style="color:rgb(139,132,207)">4</span> * width</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> colorSpaceRef = CGColorSpaceCreateDeviceRGB()</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> intent = CGColorRenderingIntent.<wbr>defaultIntent</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> bitmapInfo = CGBitmapInfo.<wbr>byteOrder32Little.union(<wbr>CGBitmapInfo(rawValue: CGImageAlphaInfo.<wbr>noneSkipFirst.rawValue))</p>
<p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">      </span><span class="gmail-m_-2989294355240401758gmail-Apple-tab-span" style="white-space:pre-wrap">     </span><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">let</span> cgImage = CGImage(width: width, height: height, bitsPerComponent: bitsPerComponent, bitsPerPixel: bitsPerPixel, bytesPerRow: bytesPerRow, space: colorSpaceRef, bitmapInfo: bitmapInfo, provider: provider!, decode: <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">nil</span>, shouldInterpolate: <span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">false</span>, intent: intent)</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><br></p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)">







</p><p class="gmail-m_-2989294355240401758gmail-p1" style="margin:0px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(255,255,255);background-color:rgb(40,43,53)"><span class="gmail-m_-2989294355240401758gmail-s1" style="color:rgb(194,52,155)">return</span> <span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(0,175,202)">UIImage</span>(cgImage: cgImage, scale: <span class="gmail-m_-2989294355240401758gmail-s3" style="color:rgb(139,132,207)">0.5</span>, orientation: <span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(0,175,202)">UIImageOrientation</span>.<span class="gmail-m_-2989294355240401758gmail-s2" style="color:rgb(0,175,202)">up</span>)</p></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">I can see this stuff is used and working on Android, but there are quite a few #ifdef IOS in there haven't been exercised in a while... And it's using quite a different rendering mechanism drawing to a CGContext compared to drawing to a byte buffer.</div><div><div class="gmail-h5"><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote"><br></div><div class="gmail_quote">On Mon, Jan 1, 2018 at 8:31 PM, jan iversen <span dir="ltr"><<a href="mailto:jani@apache.org" target="_blank">jani@apache.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div>Happy new year, very interesting work.</div><div><br></div><div>I have just updated my master, and now I see your problem with libassuan, which I am trying to solve. It is being build locally but not copied to the right place. I did a couple of commits yesterday to a.o. include your idea on how to make LIBRARY_PATH relative, thanks for that.</div><span class="gmail-m_-2989294355240401758gmail-"><div><br></div>> <span style="font-size:12.8px">try the -r flag which is for prelinking. you can see that in the .mk file</span><br></span><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-m_-2989294355240401758gmail-"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">Couldn't get that to do anything. I also tried -flto=thin which supposedly can do incremental linking, but again little effect</span></div></div></blockquote><div><br></div></span><div>Look in iOS/<span style="color:rgb(0,0,0);font-family:Menlo;font-size:11px">CustomTarget_iOS_prelink.m<wbr>k, there you will find</span></div><div><br></div><p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">        $(IOSLD) -r -ios_version_min 11.1 \</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            -syslibroot $(MACOSX_SDK_PATH) \</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            -arch `echo $(CPUNAME) |  tr '[:upper:]' '[:lower:]'` \</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            -o $(IOSOBJ) \</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            $(WORKDIR)/CObject/ios/source/<wbr>LibreOfficeKit.o \</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            `$(SRCDIR)/bin/lo-all-static-l<wbr>ibs` \</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">            $(call gb_StaticLibrary_get_target,iO<wbr>S_kitBridge)</span></p>
<p style="margin:0px;font-stretch:normal;font-size:11px;line-height:normal;font-family:Menlo;color:rgb(0,0,0)"><span style="font-variant-ligatures:no-common-ligatures">        $(AR) -r $(IOSKIT) $(IOSOBJ)</span></p><div><br></div><div>which does prelinking (different from incremental linking). You can see it generated and .o file, which is then put into an archive.</div><span class="gmail-m_-2989294355240401758gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">Nah it would be very difficult if not impossible to get a swift Framework built through make - one thing that I've learnt in iOS development is don't fight XCode. You'ld end up just calling xcodebuild anyway, which still needs the project set up correctly.</span></div></div></blockquote></span><div>??? xcode runs perfect on the command line, so I do not understand why you say it is impossible.</div><span class="gmail-m_-2989294355240401758gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div> <br></div></div></blockquote><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">* The linking of the framework takes just as long as the app did. But once you have it built, as long as you don't touch the framework, rebuilds of the app are fast</span></div></div></blockquote></span><div>This is as expected. The framework is basically a dylib so of course linking to that is a lot faster.</div><div><br></div><div>I am still not convinced making a framework is a better solution than just linking a dylib directly, at least I do not see the advantages and at least one disadvantage, one more xcode project to maintain.</div><span class="gmail-m_-2989294355240401758gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">* It's only been tested on the simulator. Needs some more stuffing about to link the correct lib for device. </span></div></div></blockquote><div><br></div></span><div>dylib works very well in the simulator, my first test on my iPad (iOS 11.2) did not turn out very well. I am also looking into another problem, it seems that the App Store, still only allows upload of statically linked  </div><span class="gmail-m_-2989294355240401758gmail-"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">*** The way it's set up in the app at the moment with 3 schemes isn't as it should be - you should have just one scheme, and use Configuration is for debug/release, and platform/arch for simulator vs device. This will work ok in the app once the framework is configured to link the correct .a file. Which I will sort out if you move forward with this</span></div></div></blockquote><div><br></div></span><div>The reason for using different schemes, is that the xcode doc recommends it, and it make the use simpler, since you just have to select a scheme.</div><div><br></div><div>Why do you think just having 1 scheme is better ?</div><span class="gmail-m_-2989294355240401758gmail-"><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">* I built out the Swift wrappers to cover all of the LibreOfficeKit functions. Have a look at Document.swift in particular. The next step would be to make an extension of Document to make iOS friendly methods for eg rendering to a UIImage</span></div></div></blockquote><div><br></div></span><div>It is a different approach, but one I like, we do however still need the C file.</div><span class="gmail-m_-2989294355240401758gmail-"><div><br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px">* I tried to get a tile rendering both in the test and the app. No good. </span><br></div><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Firstly I was trying to pass a byte buffer to paintTile as per the method signature, but it force casts that param to a CGContextRef a couple of layers down...</span></div><div><span style="font-size:12.8px">But even after creating one of those to render into a image, it crashes with an </span><span style="font-size:12.8px">uncaught exception of type com::sun::star::container::NoS<wbr>uchElementException (see pic of stack trace below) </span></div><div><span style="font-size:12.8px">Which took me deep into debugging core LibreOffice, which I didn't really want to be, and was a bit frustrating. Maybe I'm missing some init code, or passing the wrong params.</span></div><div><span style="font-size:12.8px">Feels like it might be bitrot of this tiling code that was written as a POC in 2015 or so? I wonder when the last time it worked was. You mentioned that you couldn't get it working either?</span></div></div></blockquote></span><div>My problem was more how to use the returned array in order to render it effectively.</div><div><br></div><div>The paintTile code is used both in the android version (see core/android) and the online (separate git repo), so it works.</div><div><br></div><div>You might have run into a problem with swift delivering a false type of array. </div><span class="gmail-m_-2989294355240401758gmail-"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div><span style="font-size:12.8px"><br></span></div><div><span style="font-size:12.8px">Anyway, I really think splitting into a Framework is the way to go - I think the rendering problems are probably independent of this. </span></div><div><span style="font-size:12.8px">It provides a good separation between app and library, and makes the app be able to be pure swift.</span></div><div><span style="font-size:12.8px">It would certainly make using LOK in another app much much easier, than trying to unpick the example app.</span></div></div></blockquote></span><div>Which example app ?</div><div><br></div><div>The old example app have been removed because it was very outdated.</div><div> </div><div>keep up the good work, I will get around to integrate part of it soon.</div><div><br></div><div>rgds</div><div>jan I.</div></div></div></div>
</blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>