Skip to main content
October 8, 2013
Question

Printing PDF with a transparent TextField

  • October 8, 2013
  • 1 reply
  • 567 views

I have added a TextField to every page of PDF doc, and field have alpha .4. When pages were added to a printjob with a PrintJobOptions printAsBitmap = true, only first page of printed doc has a field with transparency and then it is gone on other pages. How to solve this problem?

This topic has been closed for replies.

1 reply

Inspiring
October 8, 2013

how do you add the textfields to your flash document?

How do you separate the contents of your pages (is the document separated in scenes/keyframes or otherwise?)

October 8, 2013

I used FlexPaperViewer for a loading and preview of doc.

This is printing code:

public function printPaper():void{

                              if(_libMC.parent is DupImage){

                                        (_swfContainer.getChildAt(0) as UIComponent).addChild(_libMC);

                              }

                              _libMC.alpha = 1;

 

                              var pj:PrintJob = new PrintJob();

                              if(pj.start()){

                                        _libMC.stop();

 

                                        if((pj.pageHeight/_libMC.height) < 1 && (pj.pageHeight/_libMC.height) < (pj.pageWidth/_libMC.width))

                                                  _libMC.scaleX = _libMC.scaleY = (pj.pageHeight/_libMC.height);

                                        else if((pj.pageWidth/_libMC.width) < 1)

                                                  _libMC.scaleX = _libMC.scaleY = (pj.pageWidth/_libMC.width);

                                        var watermark:TextField = waterMarkDoc();

                                        var options:PrintJobOptions = new PrintJobOptions();

                                        options.printAsBitmap = true;

                                        for(var i:int=0;i<_libMC.framesLoaded;i++){

                                                  _libMC.gotoAndStop(i+1);

 

                                                            (_swfContainer.getChildAt(0) as UIComponent).addChild(waterMarkDoc());

                                                  pj.addPage(_swfContainer, null, options);

                                        }

                                        pj.send();

                              }

 

                              _libMC.scaleX = _libMC.scaleY = 1;

                              _libMC.alpha = 0;

                    }

October 8, 2013

Well, the problem was that I added watermark to every _swfContainer.getChildAt(0) as UIComponent. Adding if (i == 0) before statement: (_swfContainer.getChildAt(0) as UIComponent).addChild(waterMarkDoc()); solved my problem.