Author: tilman
Date: Sat Oct 26 15:15:23 2024
New Revision: 1921568
URL: http://svn.apache.org/viewvc?rev=1921568&view=rev
Log:
PDFBOX-5890: add simpler method to pass MCID
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDAbstractContentStream.java
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDAbstractContentStream.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDAbstractContentStream.java?rev=1921568&r1=1921567&r2=1921568&view=diff
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDAbstractContentStream.java
(original)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDAbstractContentStream.java
Sat Oct 26 15:15:23 2024
@@ -1352,6 +1352,24 @@ abstract class PDAbstractContentStream i
}
/**
+ * Begin a marked content sequence with a reference to the marked content
identifier (MCID).
+ *
+ * @param tag the tag to be added to the content stream
+ * @param mcid the marked content identifier (MCID)
+ * @throws IOException If the content stream could not be written
+ */
+ public void beginMarkedContent(COSName tag, int mcid) throws IOException
+ {
+ if (mcid < 0)
+ {
+ throw new IllegalArgumentException("mcid should not be negative");
+ }
+ writeOperand(tag);
+ write("<</MCID " + mcid + ">> ");
+ writeOperator(OperatorName.BEGIN_MARKED_CONTENT_SEQ);
+ }
+
+ /**
* Begin a marked content sequence with a reference to an entry in the
page resources'
* Properties dictionary.
*
Modified:
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java?rev=1921568&r1=1921567&r2=1921568&view=diff
==============================================================================
---
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java
(original)
+++
pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/PDPageContentStream.java
Sat Oct 26 15:15:23 2024
@@ -2293,6 +2293,24 @@ public final class PDPageContentStream i
}
/**
+ * Begin a marked content sequence with a reference to the marked content
identifier (MCID).
+ *
+ * @param tag the tag to be added to the content stream
+ * @param mcid the marked content identifier (MCID)
+ * @throws IOException If the content stream could not be written
+ */
+ public void beginMarkedContent(COSName tag, int mcid) throws IOException
+ {
+ if (mcid < 0)
+ {
+ throw new IllegalArgumentException("mcid should not be negative");
+ }
+ writeOperand(tag);
+ write("<</MCID " + mcid + ">> ");
+ writeOperator(OperatorName.BEGIN_MARKED_CONTENT_SEQ);
+ }
+
+ /**
* Begin a marked content sequence with a reference to an entry in the
page resources'
* Properties dictionary.
*