Search code examples
pdflib

Using matchbox to insert PDF in text flow Yes or No?


I am using matchbox to insert images into text_flow which is working nicely, I need to do the same with small PDF charts - before I go down this path just wondering if its even possible ....Yes / No ?


Solution

  • sure, instead of fitting the image you just have to use the PDF page afterwards. So when you go the way of the following PDFlib Cookbook sample http://www.pdflib.com/pdflib-cookbook/text-output/wrap-text-around-images/ (case 4) but just place a PDI page instead of the fit_image():

                    x1 = p.info_matchbox(matchboxnames[m][0], i, "x1");
                    y1 = p.info_matchbox(matchboxnames[m][0], i, "y1");
                    width = p.info_matchbox(matchboxnames[m][0], i, "width");
                    height = p.info_matchbox(matchboxnames[m][0], i, "height");
                    p.fit_pdi_page(page, x1, y1,
                        "boxsize {" + width + " " + height +
                        "} fitmethod meet position=center");