Print to pdf fails on Windows with multiple pages

panagiotis m merakosp at gmail.com
Thu Mar 24 07:18:01 EDT 2022


Hello Andreas,

This sounds like this bug https://quality.livecode.com/show_bug.cgi?id=23088,
which should be fixed in LC 9.6.6 RC-1 and newer.

If this is not the case for you, could you attach a sample stack and the
pdf to this report and reopen it? Or send it to me directly if they are
confidential. Also, it might be worth checking with the 32bit version of LC
for Windows

Kind regards,
Panos
--

On Thu, 24 Mar 2022 at 12:08, Andreas Bergendal via use-livecode <
use-livecode at lists.runrev.com> wrote:

> Hi all,
>
> TL;DR:
> App/IDE crashes/fails when printing 30+ pages to single pdf, using Windows
> 10. Works fine on Mac. Windows memory issues?
>
>
> Long version:
> I have a stack/app where a crucial feature is printing to pdf.
>
> Om Mac (LC 9.6.6 or 9.6.7 rc1) this works flawlessly with 156 posts,
> resulting in a 312 page pdf file (around 4Mb):
>
> ---
> set the printScale to 0.714286 ## This matches the A4 proportion of the
> printed area
> set the printMargins to 0,0,0,0
>
> open printing to pdf tFilename ## tFilename has been defined earlier in
> the process
>
> repeat for each line tLine in pKeyList ## pKeyList is a list of numerical
> keys
>    fillFieldsWithData tLine ## This updates several fields on the card
> with new data from an array
>    print card 1 from the topLeft of grc "page1" to the bottomRight of grc
> ”page1” ## An A4-shaped rect
>    print break
>    print card 1 from the topLeft of grc "page2" to the bottomRight of grc
> ”page2” ## An A4-shaped rect
>    print break
> end repeat
>
> close printing ## (I also un/lock screen at appropriate places around this
> script, for speed)
> ---
>
> On Windows 10, which is what my client is using, this happens:
> - If run in the IDE, it sometimes manages to created the pdf, but usually
> fails (”printing failed” error), sometimes crashes LC silently
> - If run as standalone, it can create a pdf with max 15-20 posts (2x
> pages), but if I try more then it stalls and fails, or crashes.
>
> Another feature in the app is creating the 156 pdfs individually, and this
> works flawlessly also on Windows.
> So it’s creating the combined pdf that seems too taxing for poor old
> Windows, most of the time. The client needs both features to work.
>
> Is this ”memory exhaustion” (saw that term mentioned by LCMark in the
> Forum on a different pdf problem)?
>
> What can be done about it? Can I force Windows to dedicate more memory to
> my app?
>
> I’ve tried having the pdf created on C:, on a USB stick and in SharePoint
> (the client’s preferred destination), but all fail equally.
>
> Please advise! :)
>
> Best,
> Andreas
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>


More information about the use-livecode mailing list