我在PHP中使用打印机扩展。我使用虚拟打印机打印PDF。它适用于浏览器,但在使用PHP代码时打印空白页!!
这是代码
Button button = (Button) findViewById(R.id.fab);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Fragment fragment = null;
fragment = new YourFragment();
FragmentManager frgManager = getSupportFragmentManager();
FragmentTransaction ft = frgManager.beginTransaction();
ft.addToBackStack(null);
ft.add(R.id.your_fragment_layout, fragment);
ft.commit();
}
});