private void CreateEmptyPage(PDFXEdit.IIXC_Inst inst, ref PDFXEdit.IIXC_Page pg)
        {
            pg = inst.Page_CreateEmpty(600, 600, 0, 234);



            //PDFXEdit.IOperation pOp = pInst.CreateOp(nID);
            //PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
            //input.v = pDoc;
            //PDFXEdit.ICabNode options = pOp.Params.Root["Options"];
            //options["PaperType"].v = 1; //Standard values table
            //options["StdPaperIndex"].v = 2; //A2
            //pOp.Do();
        }
        private void ConvertFormatToIndx(PDFXEdit.IIXC_Page pPage, PDFXEdit.IXC_PageFormat pFormat)
        {
            if (pPage == null)
                return;
            pPage.ConvertToFormat(pFormat);



            //PDFXEdit.IOperation pOp = pInst.CreateOp(nID);
            //PDFXEdit.ICabNode input = pOp.Params.Root["Input"];
            //input.v = pDoc;
            //PDFXEdit.ICabNode options = pOp.Params.Root["Options"];
            //options["PaperType"].v = 1; //Standard values table
            //options["StdPaperIndex"].v = 2; //A2
            //pOp.Do();
        }
示例#3
0
        private void Redraw_field_horisontal(int width, int height, PDFXEdit.IPXC_ContentCreator CC, PDFXEdit.IPXC_Page page)
        {
            for (int i = 1; i <= width + 1; i++)
            {
                CC.SetLineWidth(1);//Set line  width
                CC.MoveTo(i * Rect_size, page_Height - (2 * Rect_size)); //Draw line
                CC.LineTo(i * Rect_size, page_Height - (2 * Rect_size + (height * Rect_size)));//Draw line
                CC.StrokePath(true);//Set end of drawing current element

                if (i == width + 1)
                    x_field_bottom = i * Rect_size;
            }

            for (int i = 2; i <= height + 2; i++)
            {
                CC.SetLineWidth(1);//Set line  width
                CC.MoveTo(Rect_size, page_Height - (i * Rect_size));//Draw line
                CC.LineTo(Rect_size + (width * Rect_size), page_Height - (i * Rect_size));//Draw line
                CC.StrokePath(true);//Set end of drawing current element
            }

            for (int i = 1; i <= width; i++)
            {
                for (int j = 1; j <= height; j++)
                {
                    x = i * Rect_size + Rect_size;
                    y = page_Height - (j * Rect_size + Rect_size);
                    Color current_field_color = workspace_ob.field_ex.clr_fild[i - 1][j - 1];

                    // Define the coordinates for rect
                    rc.bottom = y - Rect_size;
                    rc.top = y;
                    rc.left = x - (Rect_size);
                    rc.right = x;

                    if (isColor)
                    {
                        CC.Rect(rc.left, rc.bottom, rc.right, rc.top); //Draw rectangle by current coordinates
                        CC.SetFillColorRGB(Get_UINT_Color(current_field_color)); //Set color of filling
                        CC.FillPath(true, true, PXC_FillRule.FillRule_EvenOdd); //Filling current element
                        CC.StrokePath(true);//Set end of drawing current element
                        page.PlaceContent(CC.Detach());//Appends drawn content to current page
                        string current_text = workspace_ob.field_ex.str_fild[i - 1][j - 1];
                        CC.SetFillColorRGB(Get_UINT_Color(Color.Black));//Set color of filling

                        for (int k = 0; k < workspace_ob.keys.Count; k++)
                        {
                            if (workspace_ob.keys[k].clr == current_field_color)
                            {
                                if (isDarkColor(workspace_ob.clr_name[k]))
                                    CC.SetFillColorRGB(Get_UINT_Color(Color.White));//Set color of filling
                            }
                        }

                        //Draw text block with current text in rc coordinates
                        CC.ShowTextBlock(current_text, ref rc, ref rc,
                            (uint)PXC_DrawTextFlags.DTF_Center | (uint)PXC_DrawTextFlags.DTF_VCenter,
                            (int)-1, null, null, null, out rc_out);
                    }
                    else
                    {
                        string current_text = workspace_ob.field_ex.str_fild[i - 1][j - 1];
                        CC.SetFillColorRGB(Get_UINT_Color(Color.Black)); //Set color of filling

                        //Draw text block with current text in rc coordinates
                        CC.ShowTextBlock(current_text, ref rc, ref rc,
                            (uint)PXC_DrawTextFlags.DTF_Center | (uint)PXC_DrawTextFlags.DTF_VCenter,
                            (int)-1, null, null, null, out rc_out);
                    }
                    CC.StrokePath(true);//Set end of drawing current element
                    page.PlaceContent(CC.Detach()); //Appends drawn content to current page
                }
            }
        }