@AlexFang,
It looks like @PeterOrbok figured this out for PDF:
Do you think that would work for your case?